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

Re: plpgsql allowing null fields in insert commands?

From: John DeSoi <desoi(at)pgedit(dot)com>
To: "Celia McInnis" <celia(at)drmath(dot)ca>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: plpgsql allowing null fields in insert commands?
Date: 2005-03-16 13:08:18
Message-ID: 76E73F22-961C-11D9-8BAD-000A95B03262@pgedit.com (view raw or flat)
Thread:
Lists: pgsql-novice
Celia,

On Mar 15, 2005, at 5:53 PM, Celia McInnis wrote:

> In a plpgsql procedure is there any way to form an insert command 
> which has
> some null values for values of the inputs?
>
> Currently when I form such a command, the command becomes null if 
> there are
> any null values inserted for the fields.

You can insert null values in an insert statement or have row values be 
null by not including them in the insert statement. But if you are 
getting errors because of this it is likely the column specification of 
the table is setup disallow null values.

If this does not answer your question, post an insert example with the 
error and the table specification.


John DeSoi, Ph.D.
http://pgedit.com/
Power Tools for PostgreSQL


In response to

pgsql-novice by date

Next:From: Stephan SzaboDate: 2005-03-16 14:07:59
Subject: Re: plpgsql allowing null fields in insert commands?
Previous:From: Sean DavisDate: 2005-03-16 11:18:29
Subject: Re: fetching text file from internet

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