Francisco Reyes <lists@xxxxxxxxxxxxxxxx> writes: > v_sql := 'INSERT INTO messagecatalog_'|| > to_char(NEW.timestampfield,'YYYY')|| > '(field1, field2) values (' > ||New.field1||','||New.field2||') > ')'; > EXECUTE v_sql; This is not a particularly good way of accomplishing partitioning, as you'll be needing *every* part of your application to be explicitly aware of the exact partitioning scheme. However, if you insist on doing it like that, don't you need quote_literal() for the field values? regards, tom lane ---------------------------(end of broadcast)--------------------------- TIP 4: Have you searched our list archives? http://archives.postgresql.org/