Ok - there was a column misordering in my rather complicated procedure.
The form which works to handle possibly null-valued (timestamp) values is indeed:
u:='INSERT INTO ' || mytable || ' VALUES(' ||
COALESCE(quote_literal(mytime),'NULL') || ')';
Thanks for your help. I hope to be good at this plpgsql at some point!
Celia
> Hmm, my simple tests worked, can you show the full function
> definition and the table definition of the table you're trying to
> insert into?
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/docs/faq
--
Open WebMail Project (http://openwebmail.org)