diff --git a/src/pgsql/pgsql-ddl-citus.lisp b/src/pgsql/pgsql-ddl-citus.lisp index 2fe2028..7239fdf 100644 --- a/src/pgsql/pgsql-ddl-citus.lisp +++ b/src/pgsql/pgsql-ddl-citus.lisp @@ -17,4 +17,4 @@ (rule-col-name (column-name (citus-distributed-rule-using rule)))) (format stream "SELECT create_distributed_table('~a', '~a');" (format-table-name rule-table) - (apply-identifier-case rule-col-name)))) + (ensure-unquoted rule-col-name)))) diff --git a/src/utils/citus.lisp b/src/utils/citus.lisp index 541e6e2..b846cdb 100644 --- a/src/utils/citus.lisp +++ b/src/utils/citus.lisp @@ -70,7 +70,10 @@ table-name schema-name)))))) (defun citus-find-table (catalog table) - (let* ((table-name (cdr (table-source-name table))) + (let* ((source-name (table-source-name table)) + (table-name (etypecase source-name + (string source-name) + (cons (cdr source-name)))) (schema-name (schema-name (table-schema table)))) (or (find-table (find-schema catalog schema-name) table-name) (error (make-condition 'citus-rule-table-not-found