Обсуждение: The use of sequences

Поиск
Список
Период
Сортировка

The use of sequences

От
Roy Sigurd Karlsbakk
Дата:
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@christianianett.no>
ChristianiaNett A/S, Akersgt. 11, 0158 OSLO, +47 2247 3100
http://www.christianianett.no/ (norwegian)


Вложения

Re: [GENERAL] The use of sequences

От
Jeremiah Davis
Дата:
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@christianianett.no>
> ChristianiaNett A/S, Akersgt. 11, 0158 OSLO, +47 2247 3100
> http://www.christianianett.no/ (norwegian)
>
>
begin:vcard
n:Karlsbakk;Roy Sigurd
x-mozilla-html:FALSE
org:ChristianiaNett A/S
version:2.1
email;internet:roy@christianianett.no
title:Seniorkonsulent
x-mozilla-cpt:;0
fn:Roy Sigurd Karlsbakk
end:vcard