Re: plpgsql allowing null fields in insert commands?

From: "Celia McInnis" <celia(at)drmath(dot)ca>
To: Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: plpgsql allowing null fields in insert commands?
Date: 2005-03-17 01:10:01
Message-ID: 20050317010341.M24166@drmath.ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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)

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message brew 2005-03-17 07:53:01 Re: XML and Postgres
Previous Message Stephan Szabo 2005-03-16 20:22:39 Re: plpgsql allowing null fields in insert commands?