Use quote_identifier() to properly escape column names in UPDATE statement, per report from Dimitrije Radojevic.

This commit is contained in:
Josh Kupershmidt 2012-09-18 20:13:21 -07:00 committed by Daniele Varrazzo
parent 612495ecd6
commit bc20ace32b

View File

@ -80,7 +80,7 @@ LANGUAGE sql STABLE STRICT;
CREATE FUNCTION reorg.get_assign(oid, text) RETURNS text AS
$$
SELECT '(' || array_to_string(reorg.array_accum(attname), ', ') ||
SELECT '(' || array_to_string(reorg.array_accum(quote_ident(attname)), ', ') ||
') = (' || $2 || '.' ||
array_to_string(reorg.array_accum(quote_ident(attname)), ', ' || $2 || '.') || ')'
FROM (SELECT attname FROM pg_attribute