Re: [GENERAL] The use of sequences

From: Jeremiah Davis <jdavis(at)gaslightmedia(dot)com>
To: Roy Sigurd Karlsbakk <roy(at)christianianett(dot)no>
Cc: "pgsql-general(at)postgreSQL(dot)org" <pgsql-general(at)postgreSQL(dot)org>
Subject: Re: [GENERAL] The use of sequences
Date: 1998-08-18 15:54:08
Message-ID: Pine.3.89.9808181137.A20075-a200000@onramp.freeway.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-sql

CREATE SEQUENCE some_sequence start 1 increment 1;

CREATE TABLE person (
id int4 default nextval('some_sequence'),
name varchar(200),
description text);

INSERT INTO person VALUES(nextval('some_sequence'),'Jeremiah','not much');

or

INSERT INTO person(name,description) VALUES('Jeremiah','not much');

On Tue, 18 Aug 1998, Roy Sigurd Karlsbakk wrote:

> Could somebody tell me how I can make efficient use of sequences? I am
> familiar with Oracle's sequences and they usually work as the following
> example:
> INSERT INTO PERSON table(some_sequence.nextval,data,data,data);
>
> How do they work in postgreSQL?
>
> Roy
>
> --
> Roy Sigurd Karlsbakk - MCSE, CNE, CLS, ASE - <roy(at)christianianett(dot)no>
> ChristianiaNett A/S, Akersgt. 11, 0158 OSLO, +47 2247 3100
> http://www.christianianett.no/ (norwegian)
>
>

Attachment Content-Type Size
roy.vcf text/x-vcard 204 bytes

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Os Tyler 1998-08-18 18:18:47 sequences/operators
Previous Message Herouth Maoz 1998-08-18 15:27:20 Re: [GENERAL] The use of sequences

Browse pgsql-sql by date

  From Date Subject
Next Message Toni Steinhauer 1998-08-19 02:12:47 Cannot read block 0
Previous Message Herouth Maoz 1998-08-18 15:27:20 Re: [GENERAL] The use of sequences