EXECUTE 'INSERT INTO ' || tablename_2 || ' VALUES (($1).*)' USING NEW ;
Greenplum (based on Postgres 8.2) doesn't support this 'using' grammar, how to do this operator in Greenplum 4.3
Error info:
ERROR: syntax error at or near "USING" LINE 1: ...LECT 'INSERT INTO ' || $1 ||' VALUES (($1).)' USING $2 ^ QUERY: SELECT 'INSERT INTO ' || $1 ||' VALUES (($1).)' USING $2 CONTEXT: SQL statement in PL/PgSQL function "dp_insert_trigger" near line 13
The
USING
clause for dynamic commands was introduced in version 8.4. In 8.2 you have to assemble the string with all of its dynamic parts using string concatenation and thequote_literal()
,quote_identifier()
andquote_nullable()
functions.PG 8.2 is unsupported since December 2011 and even the respectable 8.4 is beyond its lifetime for more than 18 months now. You should really upgrade.