Re: Stored procedure

From: Ragnar <gnari(at)hive(dot)is>
To: pgsql-general(at)postgresql(dot)org
Cc: Ted Byers <r(dot)ted(dot)byers(at)rogers(dot)com>
Subject: Re: Stored procedure
Date: 2005-12-23 12:40:24
Message-ID: 1135341624.803.63.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, 2005-12-22 at 12:42 -0500, Jaime Casanova wrote:
> On 12/22/05, Ted Byers <r(dot)ted(dot)byers(at)rogers(dot)com> wrote:
> >
> > INSERT INTO foo (auto,text)
> > VALUES(NULL,'text'); # generate ID by inserting NULL
>
> and this of course is bad... if a insert NULL i want the NULL to be inserted.
> SQL Standard way of doing things is "ommiting the auto incremental fld at all"
>
> INSERT INTO foo (text) VALUES ('text');

and then there is the god old DEFAULT value:

INSERT INTO foo (auto,text) VALUES(DEFAULT,'text');

gnari

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Karsten Hilbert 2005-12-23 14:01:49 Re: Inheritance Algebra
Previous Message Marko Kreen 2005-12-23 10:05:54 Re: Why is create function bringing down the Backend server?