Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-novice by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group