mirror of
https://github.com/dimitri/pgloader.git
synced 2026-05-04 18:36:12 +02:00
parent
8c2cda75e5
commit
a0bac47101
@ -167,10 +167,14 @@
|
||||
(schema (table-list catalog-or-table))
|
||||
(table (list catalog-or-table)))))
|
||||
(sql
|
||||
(format nil "TRUNCATE ~{~a~^,~};" target-list)))
|
||||
(pgsql-execute sql)
|
||||
;; return how many tables we just TRUNCATEd
|
||||
(length target-list)))
|
||||
(when target-list
|
||||
(format nil "TRUNCATE ~{~a~^,~};" target-list))))
|
||||
(if target-list
|
||||
(progn
|
||||
(pgsql-execute sql)
|
||||
;; return how many tables we just TRUNCATEd
|
||||
(length target-list))
|
||||
0)))
|
||||
|
||||
(defun disable-triggers (table-name)
|
||||
"Disable triggers on TABLE-NAME. Needs to be called with a PostgreSQL
|
||||
|
||||
17
test/mysql/db789.load
Normal file
17
test/mysql/db789.load
Normal file
@ -0,0 +1,17 @@
|
||||
LOAD DATABASE
|
||||
FROM mysql://root@localhost/db789
|
||||
INTO postgres:///pgloader
|
||||
|
||||
WITH data only, truncate, create no tables
|
||||
|
||||
MATERIALIZE VIEWS proceed
|
||||
|
||||
INCLUDING ONLY TABLE NAMES MATCHING 'proceed'
|
||||
|
||||
BEFORE LOAD DO
|
||||
$$ drop schema if exists matview cascade; $$,
|
||||
$$ drop schema if exists db789 cascade; $$,
|
||||
$$ create schema db789; $$,
|
||||
$$ create table db789.refrain (id char(1) primary key); $$,
|
||||
$$ create table db789.proceed (id char(1) primary key); $$;
|
||||
|
||||
8
test/mysql/db789.sql
vendored
Normal file
8
test/mysql/db789.sql
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
drop database if exists db789;
|
||||
create database db789;
|
||||
use db789;
|
||||
|
||||
create table refrain (id char(1) primary key);
|
||||
insert into refrain values ('a'), ('b'), ('c'), ('d');
|
||||
|
||||
create view proceed as select * from refrain where id > 'b';
|
||||
Loading…
x
Reference in New Issue
Block a user