Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[PORTS] creating sequences?

0 views
Skip to first unread message

David Wetzel

unread,
Aug 1, 1998, 3:00:00 AM8/1/98
to pgsql...@postgresql.org
Hello!

I have a table that has a primary key nr.

"select max(nr) from pathobefund;" returns:

max
---
7
(1 row)

Now, I would like to have a sequence for nr. How do I create one that starts
exactly at max(nr) als last value?

"create sequence eo_pk_for_pathobefund start select max(nr) from
pathobefund;" does not work.

Please help me.


Dave


David Wetzel

unread,
Aug 3, 1998, 3:00:00 AM8/3/98
to Vadim Mikheev
> From: Vadim Mikheev <va...@krs.ru>

> vac=> \h create sequence
> Command: create sequence
> Description: create a new sequence number generator
> Syntax:
> create sequence <sequence_name>
> [increment <NUMBER>]
> [start <NUMBER>]
> [minvalue <NUMBER>]
> [maxvalue <NUMBER>]
> [cache <NUMBER>]
> [cycle];
>
> Vadim

I know that but I want max(nr) from table pathobefund als start value. And I
want to generate a slq file that can I send to psql without selecting
max(nr) first, writing it down and insert it...

---
_ _
_(_)(_)_ David Wetzel, Turbocat's Development,
(_) __ (_) Buchhorster Strasse, D-16567 Muehlenbeck/Berlin, FRG,
_/ \_ Fax +49 33056 82835 NeXTmail da...@turbocat.de
(______) http://www.turbocat.de/


0 new messages