Re: plpgsql allowing null fields in insert commands? - Mailing list pgsql-novice

From Celia McInnis
Subject Re: plpgsql allowing null fields in insert commands?
Date
Msg-id 20050317010341.M24166@drmath.ca
Whole thread Raw
In response to Re: plpgsql allowing null fields in insert commands?  (Stephan Szabo <sszabo@megazone.bigpanda.com>)
List pgsql-novice
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)


pgsql-novice by date:

Previous
From: Stephan Szabo
Date:
Subject: Re: plpgsql allowing null fields in insert commands?
Next
From: brew@theMode.com
Date:
Subject: Re: XML and Postgres