mirror of
https://github.com/dimitri/pgloader.git
synced 2026-05-04 18:36:12 +02:00
Use the constraint name when we have it.
That's important for Citus, which doesn't know how to ADD a constraint without a name.
This commit is contained in:
parent
381ac9d1a2
commit
760763be4b
@ -204,8 +204,9 @@
|
||||
;; don't use the index schema name here, PostgreSQL doesn't
|
||||
;; like it, might be implicit from the table's schema
|
||||
;; itself...
|
||||
"ALTER TABLE ~a ADD ~a USING INDEX ~a;"
|
||||
"ALTER TABLE ~a ADD~@[ CONSTRAINT ~a~] ~a USING INDEX ~a;"
|
||||
(format-table-name table)
|
||||
(index-conname index)
|
||||
(cond ((index-primary index) "PRIMARY KEY")
|
||||
((index-unique index) "UNIQUE"))
|
||||
index-name)))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user