From ad56cf808bf7bb832e39a7cb4559811b33941bae Mon Sep 17 00:00:00 2001 From: Dimitri Fontaine Date: Sun, 18 Dec 2016 19:18:26 +0100 Subject: [PATCH] Fix PostgreSQL index naming. A PostgreSQL index is always created in the same schema as the table it is defined against, and the CREATE INDEX command doesn't accept schema qualified index names. --- src/pgsql/pgsql-ddl.lisp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/pgsql/pgsql-ddl.lisp b/src/pgsql/pgsql-ddl.lisp index fd573d7..dc29b1a 100644 --- a/src/pgsql/pgsql-ddl.lisp +++ b/src/pgsql/pgsql-ddl.lisp @@ -154,8 +154,7 @@ ;; LOCK on the table before we have the index done already (or (index-sql index) (format stream - "CREATE UNIQUE INDEX ~@[~a.~]~a ON ~a (~{~a~^, ~})~@[ WHERE ~a~];" - (when (index-schema index) (schema-name (index-schema index))) + "CREATE UNIQUE INDEX ~a ON ~a (~{~a~^, ~})~@[ WHERE ~a~];" index-name (format-table-name table) (index-columns index) @@ -178,9 +177,8 @@ (t (or (index-sql index) (format stream - "CREATE~:[~; UNIQUE~] INDEX ~@[~a.~]~a ON ~a (~{~a~^, ~})~@[ WHERE ~a~];" + "CREATE~:[~; UNIQUE~] INDEX ~a ON ~a (~{~a~^, ~})~@[ WHERE ~a~];" (index-unique index) - (when (index-schema index) (schema-name (index-schema index))) index-name (format-table-name table) (index-columns index)