Re: INSERT requires SERIAL column?

From: "D'Arcy J(dot)M(dot) Cain" <darcy(at)druid(dot)net>
To: "Christopher Kings-Lynne" <chriskl(at)familyhealth(dot)com(dot)au>, <otisg(at)ivillage(dot)com>
Cc: pgsql-sql(at)PostgreSQL(dot)org
Subject: Re: INSERT requires SERIAL column?
Date: 2002-02-27 08:51:51
Message-ID: 20020227085151.EB2131BB4@druid.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On February 27, 2002 02:50 am, Christopher Kings-Lynne wrote:
> > Question:
> > Is this really necessary or am I missing something?
> > I thought specifying SERIAL columns is not neccessary in INSERT
> > statements.
>
> You need to specify the columns to insert into, skipping over the SERIAL
> column:

Good advice for any INSERT statement except perhaps one time queries typed
directly into the monitor. Databases change and INSERT statements in code
that assume otherwise can bite you on the ass in hard to find ways.

--
D'Arcy J.M. Cain <darcy(at){druid|vex}.net> | Democracy is three wolves
http://www.druid.net/darcy/ | and a sheep voting on
+1 416 425 1212 (DoD#0082) (eNTP) | what's for dinner.

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Bruno Wolff III 2002-02-27 13:21:49 Re: Bad design or SQL statment quandary
Previous Message Christopher Kings-Lynne 2002-02-27 07:54:28 Re: Err. compiling func. with SET TRANS...