mirror of
https://github.com/dimitri/pgloader.git
synced 2026-01-30 19:41:01 +01:00
It turns out we forgot to add support for internal catalog munging clauses to SQLite support. The catalogs being normalized means there's no extra work here other than allowing the parser to accept those clauses and then pass them over to our generic `copy-database' method implementation. It is to be noted that SQLite has no support for schemas as per the standard and PostgreSQL, so that when we inspect the database schema we create a nil entry here. It's then not possible to ALTER SCHEMA nil RENAME TO 'target'; unfortunately, but it's easy enough to SET search_path to 'target' anyway, as shown in the modified test case. Fix #552.
18 lines
549 B
Fish
18 lines
549 B
Fish
load database
|
|
from 'sqlite/Chinook_Sqlite_AutoIncrementPKs.sqlite'
|
|
into postgresql:///pgloader
|
|
|
|
-- including only table names like 'Invoice%'
|
|
|
|
with workers = 4,
|
|
concurrency = 2,
|
|
include drop, create tables, create indexes, reset sequences, foreign keys
|
|
|
|
-- alter table names matching ~/./ set schema 'chinook'
|
|
alter table names matching 'Employee' rename to 'staff'
|
|
|
|
set work_mem to '16MB', maintenance_work_mem to '512 MB',
|
|
search_path to 'chinook'
|
|
|
|
before load do
|
|
$$ create schema if not exists chinook; $$; |