Fix issur #29, using proper quoting.

The patch from pull request #30 was hard-coding the PostgreSQL side quoting,
we are using the quote_ident() function instead, as it's now available in
every PostgreSQL production release (8.4 included).
This commit is contained in:
Dimitri Fontaine 2014-02-08 17:31:59 +01:00
parent a6e2c6364f
commit 8f6915d626
2 changed files with 3 additions and 3 deletions

View File

@ -196,7 +196,7 @@ BEGIN
from replace(pg_get_expr(d.adbin, d.adrelid),
'nextval', 'setval'))
|| ', (select greatest(max(' || a.attname || '), 1) from only '
|| nspname || '.' || relname || '));' as sql
|| quote_ident(nspname) || '.' || quote_ident(relname) || '));' as sql
FROM pg_class c
JOIN pg_namespace n on n.oid = c.relnamespace
JOIN pg_attribute a on a.attrelid = c.oid

View File

@ -32,14 +32,14 @@
The type naming is hardcoded to be table-name_column-name"
(declare (ignore type ctype typemod))
(format nil "~a_~a" table-name column-name))
(format nil "\"~a_~a\"" table-name column-name))
(defun cast-set (table-name column-name type ctype typemod)
"Cast MySQL inline SET type to using a PostgreSQL ENUM Array.
The ENUM data type name is hardcoded to be table-name_column-name"
(declare (ignore type ctype typemod))
(format nil "~a_~a[]" table-name column-name))
(format nil "\"~a_~a\"[]" table-name column-name))
;;;
;;; The default MySQL Type Casting Rules