Re: lisp mail archive software
Daniel Barlow <[email protected]> Mon, 07 Jul 2003 13:56:57 +0100
| Newsgroups | gmane.lisp.clump |
|---|---|
| Message-ID | <[email protected]> |
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 John DeSoi <[email protected]> writes: >> insert into customers (id, name) values >> (nextval('name_of_sequence'), 'Foobar'); >> > > Right, but if the type of the id column is 'serial' then the nextval > is assigned automatically when you do an insert so you don't have to > do it explicitly (i.e. call nextval in your sql insert). The original > statement was "special select after inserting a new row with an > autoincrement key." For what it's worth, in Postgres this is little more than syntactic sugar - stargreen=> \d order_line Table "public.order_line" Column | Type | Modifiers - ----------------------+------------------------+------------------------------------------------------- [...] id | integer | not null default nextval('"order_line_id_seq"'::text) - -dan - -- http://www.cliki.net/ - Link farm for free CL-on-Unix resources -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE/CW4eHDK5ZnWQiRMRAkL0AKCzs8rw/2b2vToZJrn6DewIOgb1TwCgsIvs N+Oniv1gCuDNFY5yeHIFBWo= =m8Hv -----END PGP SIGNATURE-----