From: D'Arcy J.M. Cain <darcy@druid.net>
To: Christopher Kings-Lynne <chriskl@familyhealth.com.au>
To: otisg@ivillage.com
Cc: pgsql-sql@PostgreSQL.org
Subject: Re: INSERT requires SERIAL column?
Date: Wed, 27 Feb 2002 03:51:51 -0500
Message-ID: <20020227085151.EB2131BB4@druid.net> (raw)
In-Reply-To: <GNELIHDDFBOCMGBFGEFOOEJCCBAA.chriskl@familyhealth.com.au>
References: <GNELIHDDFBOCMGBFGEFOOEJCCBAA.chriskl@familyhealth.com.au>
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@{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.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: darcy@druid.net, chriskl@familyhealth.com.au, otisg@ivillage.com
Subject: Re: INSERT requires SERIAL column?
In-Reply-To: <20020227085151.EB2131BB4@druid.net>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox