Article View: ahn.tech.linux
Article #3338Re: Postgresql Success rate
From: Don Baccus
Date: Thu, 01 Jul 1999 00:00
Date: Thu, 01 Jul 1999 00:00
22 lines
1626 bytes
1626 bytes
In article <377AE24E.A459B18E@mo-net.com>,
Jason B. Johnson <jbjohns@mo-net.com> wrote:
>It seems pretty cool. I don't use it because I use serial fields alot, and
>having to define a function to do that just doesn't "feel" right to me.
? You can define columns to be serial.
"create table foo (i serial);" Just tried it, does just
what you'd expect.
They're rewritten to be sequences, and "nextval()" is automatically
called when you insert a new record.
The Postgres sequence and "nextval()"/"currval()" functions are
semantically equivalent to how you do such things in Oracle (the
syntax is slightly different as in Oracle you say "seq.nextval"
rather than "nextval('seq')").
--
- Don Baccus, Portland OR <dhogaza@pacifier.com>
Nature photos, on-line guides, at http://donb.photo.net
Technical Details
Message-ID:
<377bd3a4.0@news.pacifier.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<7ldl0h$26l8$1@nntp01.global.co.za> <377AE24E.A459B18E@mo-net.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f5392,a1b03957da4370c4 X-Google-Attributes: gidf5392,public X-Google-Thread: 10c696,a1b03957da4370c4 X-Google-Attributes: gid10c696,public X-Google-Thread: 11033e,a1b03957da4370c4 X-Google-Attributes: gid11033e,public X-Google-Thread: faa64,a1b03957da4370c4 X-Google-Attributes: gidfaa64,public From: dhogaza@pacifier.com (Don Baccus) Subject: Re: Postgresql Success rate Date: 1999/07/01 Message-ID: <377bd3a4.0@news.pacifier.com> X-Deja-AN: 496155682 References: <7ldl0h$26l8$1@nntp01.global.co.za> <377AE24E.A459B18E@mo-net.com> X-Trace: 1 Jul 1999 13:46:28 PST, 199.2.117.161 Organization: Pacifier Online Data Service Newsgroups: ahn.tech.linux,alt.os.linux,comp.os.linux.development.apps,comp.os.linux.development.system