mirror of
https://github.com/dimitri/pgloader.git
synced 2026-05-04 18:36:12 +02:00
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:
parent
a6e2c6364f
commit
8f6915d626
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user