Re: automatic insert of next sequence value? - Thank you!

From: J B Bell <jbbell(at)intergate(dot)ca>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: automatic insert of next sequence value? - Thank you!
Date: 2000-10-12 10:56:44
Message-ID: 20001012105644.B6823@staff.intergate.ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Travis Bauer 2000-10-12 12:20:03 Re: Re: R: PostgreSQL book
Previous Message J B Bell 2000-10-12 10:11:25 automatic insert of next sequence value?