Re: automatic insert of next sequence value? - Thank you! - Mailing list pgsql-general

From J B Bell
Subject Re: automatic insert of next sequence value? - Thank you!
Date
Msg-id 20001012105644.B6823@staff.intergate.ca
Whole thread Raw
In response to Re: automatic insert of next sequence value?  (Alfred Perlstein <bright@wintelcom.net>)
List pgsql-general
On Thu, Oct 12, 2000 at 10:22:10AM -0700, Alfred Perlstein wrote:
>> [JB asks about why INSERT INTO foo VALUES ( 0, ... ) doesn't trip the
>> default value]
>
> This is because you're abusing INSERT, the porper way to do insert is
> to specifify which columns explicitly:
>
> INSERT INTO foo (col1, col3) VALUES ( 5, 6 );
>
> now, if col2 has a default value it will be set properly.

I feel so dirty.  I only hope the INSERT statement can forgive me, and that
I can make reparations for my sins.  :-)

> -Alfred

Thanks Alfred, and to the several other people who responded so quickly
to my, ahem, query.  No need to cc: me, btw, I'm on the list and hope to
learn more from it.

--JB

--
------------------------------------------------------------------
                J B Bell            |              /~\
          Systems Administrator     |       ASCII  \ /  Against
            Internet Gateway        |      Ribbon   X   HTML
                                    |    Campaign  / \  Mail

pgsql-general by date:

Previous
From:
Date:
Subject: Re: automatic insert of next sequence value?
Next
From: "K Parker"
Date:
Subject: Re: PostgreSQL book