The following bug has been logged online:
Bug reference: 4402
Logged by: Joachim Unger
Email address: jo.unger@arcor.de
PostgreSQL version: 8.3
Operating system: Windwos XP Professional 32 Bit
Description: Column expansion: date comes wthout a cast
Details:
The column expansion lists date types without a date cast.
Here is an example where I'm using NEW inside a trigger:
[...]
ins_sql := 'INSERT INTO ' || quote_ident(new_child_table) || '('
||col_names(new_child_table) || ') VALUES ' || NEW;
RAISE NOTICE 'INSERT: %',ins_sql;
EXECUTE ins_sql;
[...]
Execution of the generated SQL throws an error:
ERROR: column "adate" is of type date but expression is of type integer
LINE 1: INSERT INTO table_2008_1(id,adate) VALUES (1,2008-01-30)
HINT: You will need to rewrite or cast the expression.
That hint describes exactly what is missing:(1,DATE '2008-01-30')