pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruno Boettcher <bboett@erm1.u-strasbg.fr>
To: pgsql-sql@postgresql.org
Subject: reinitialize a sequence?
Date: Tue, 5 Dec 2000 00:30:34 +0100
Message-ID: <20001205003034.D31987@erm1.u-strasbg.fr> (raw)

hello,
played a bit around with the serial type....
wanted to adapt my already existing tables to this system...
dumped the DB, created the new tables, loaded old data in....

all works, until i try to insert something without specifying the id
field (that's the now sequential field). And the reason is that the
sequene is set to 1.....

is there a simple way to tell all sequences to take the max value +1 of
their respective tables? (a bit like the vacuum command?)

i tryed to set the value by hand, but did something wrong :D the command
didn't completed:
fibu=> update journal_id_seq set last_value=1187;
ERROR:  You can't change sequence relation journal_id_seq

surely something real stupid again, but i never used sequences till
now... and there's no example in the docu.... (BTW would be nice if this
was addressed in the documentation)



-- 
ciao bboett
==============================================================
bboett@earthling.net
http://inforezo.u-strasbg.fr/~bboett http://erm1.u-strasbg.fr/~bboett
===============================================================
the total amount of intelligence on earth is constant.
human population is growing....



view thread (5+ messages)  latest in thread

Message-ID: <20001205003034.D31987@erm1.u-strasbg.fr>
Permalink:  ../20001205003034.D31987@erm1.u-strasbg.fr/
Also on:    postgresql.org/message-id/20001205003034.D31987@erm1.u-strasbg.fr

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: bboett@erm1.u-strasbg.fr
  Subject: Re: reinitialize a sequence?
  In-Reply-To: <20001205003034.D31987@erm1.u-strasbg.fr>
  References: <20001205003034.D31987@erm1.u-strasbg.fr>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox