Re: [SQL] INSERT w/o variable names for a SERIAL type?

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Emils Klotins <emils(at)mail(dot)usis(dot)bkc(dot)lv>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: [SQL] INSERT w/o variable names for a SERIAL type?
Date: 2000-02-27 15:18:39
Message-ID: Pine.LNX.4.21.0002260418130.3063-100000@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Emils Klotins writes:

> Now, if I want to write a general #define, I'd need to have a way
> to specify 'default' for SERIAL field, for, if I omit the id field in
> VALUES, I need to specify all the rest of the fields explicitly.
>
> Is there any value I could put in place of id in VALUES part, to
> make it replaced with the next value in sequence?

INSERT INTO my_table VALUES (a, b, c, DEFAULT, x, y, z, ...);

--
Peter Eisentraut Sernanders väg 10:115
peter_e(at)gmx(dot)net 75262 Uppsala
http://yi.org/peter-e/ Sweden

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2000-02-27 18:29:21 Re: [SQL] INSERT w/o variable names for a SERIAL type?
Previous Message Tom Lane 2000-02-27 07:48:20 Re: [SQL] Default sequence values