dimitri / pgloader

Migrate to PostgreSQL in a single command!
http://pgloader.io
Other
5.45k stars 548 forks source link

SQLITE: Foreign keys not respecting quote identifiers option #1577

Open marinhio75 opened 7 months ago

marinhio75 commented 7 months ago

Hi, first of all thank you for pgloader ^^

pgloader version "3.6.7~devel" compiled with SBCL 2.2.9.debian

inside of load-script:

load database from sqlite:///path/db.hedgedoc.sqlite into pgsql://user:pw@mydbsite/my_DB WITH include drop, create tables, create indexes, reset sequences, quote identifiers, foreign keys, prefetch rows = 1000, batch rows = 1000, batch size = 1MB

set work_mem to '64MB', maintenance_work_mem to '512 MB';

After start: pgloader -v --root-dir=/root/pgloader/tmp load-script

NOTICE ALTER TABLE "Notes" ADD FOREIGN KEY(ownerId) REFERENCES "Users"(id) ON UPDATE NO ACTION ON DELETE CASCADE 2024-04-17T11:04:10.660052Z ERROR PostgreSQL Database error 42703: Spalte »ownerid«, die im Fremdschlüssel verwendet wird, existiert nicht QUERY: ALTER TABLE "Notes" ADD FOREIGN KEY(ownerId) REFERENCES "Users"(id) ON UPDATE NO ACTION ON DELETE CASCADE 2024-04-17T11:04:10.660052Z NOTICE ALTER TABLE "Revisions" ADD FOREIGN KEY(noteId) REFERENCES "Notes"(id) ON UPDATE NO ACTION ON DELETE CASCADE 2024-04-17T11:04:10.660052Z ERROR PostgreSQL Database error 42703: Spalte »noteid«, die im Fremdschlüssel verwendet wird, existiert nicht QUERY: ALTER TABLE "Revisions" ADD FOREIGN KEY(noteId) REFERENCES "Notes"(id) ON UPDATE NO ACTION ON DELETE CASCADE 2024-04-17T11:04:10.660052Z NOTICE ALTER TABLE "Authors" ADD FOREIGN KEY(userId) REFERENCES "Users"(id) ON UPDATE NO ACTION ON DELETE CASCADE 2024-04-17T11:04:10.660052Z ERROR PostgreSQL Database error 42703: Spalte »userid«, die im Fremdschlüssel verwendet wird, existiert nicht QUERY: ALTER TABLE "Authors" ADD FOREIGN KEY(userId) REFERENCES "Users"(id) ON UPDATE NO ACTION ON DELETE CASCADE 2024-04-17T11:04:10.660052Z NOTICE ALTER TABLE "Authors" ADD FOREIGN KEY(noteId) REFERENCES "Notes"(id) ON UPDATE NO ACTION ON DELETE CASCADE 2024-04-17T11:04:10.664052Z ERROR PostgreSQL Database error 42703: Spalte »noteid«, die im Fremdschlüssel verwendet wird, existiert nicht QUERY: ALTER TABLE "Authors" ADD FOREIGN KEY(noteId) REFERENCES "Notes"(id) ON UPDATE NO ACTION ON DELETE CASCADE 2024-04-17T11:04:10.668052Z LOG report summary reset table name errors read imported bytes total time read write


 "Create Foreign Keys"          4          4          0                     0.008s

  Total import time          ✓     110446     110446   647.2 MB         16.464s

p.e. with quote identifiers i get errors ALTER TABLE "Notes" ADD FOREIGN KEY(ownerId) REFERENCES "Users"(id) ON UPDATE NO ACTION ON DELETE CASCADE get error Column "ownerid" used in foreign key does not exist

same in ALTER TABLE "Authors" ADD FOREIGN KEY(noteId) REFERENCES "Notes"(id) ON UPDATE NO ACTION ON DELETE CASCADE get error Column "noteid" used in foreign key does not exist

in SQLITE DB foreign key are (nodeId) or (ownerId)

Thank you for every hint

Cheers Marinhio