mirror of
https://github.com/dimitri/pgloader.git
synced 2026-05-05 02:46:10 +02:00
Attempt to fix foreign-key creation to tables that have been filtered out.
See #1016 where we try to build the DDL for a foreign key that references tables that are not found in our catalogs. We should probably just ignore those foreign keys, as we might have a partial load to implement.
This commit is contained in:
parent
2e8ce7a83c
commit
3b5c29b030
@ -233,8 +233,15 @@
|
||||
(let ((fk-sql-list
|
||||
(loop :for table :in (table-list catalog)
|
||||
:append (loop :for fkey :in (table-fkey-list table)
|
||||
:for sql := (format-create-sql fkey)
|
||||
:collect sql)
|
||||
;; we might have loaded fkeys referencing tables that
|
||||
;; have not been included in (or have been excluded
|
||||
;; from) the load
|
||||
:unless (and (fkey-table fkey)
|
||||
(fkey-foreign-table fkey))
|
||||
:do (log-message :debug "Skipping foreign key ~a" fkey)
|
||||
:when (and (fkey-table fkey)
|
||||
(fkey-foreign-table fkey))
|
||||
:collect (format-create-sql fkey))
|
||||
:append (loop :for index :in (table-index-list table)
|
||||
:do (loop :for fkey :in (index-fk-deps index)
|
||||
:for sql := (format-create-sql fkey)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user