Received: from homer.websystems.co.za (unknown [196.25.70.70]) by postgresql.org (Postfix) with ESMTP id 61023475D46 for ; Tue, 26 Mar 2002 15:17:08 -0500 (EST) Received: from hano (bnb53-01-p24.nt.saix.net [155.239.180.24]) by homer.websystems.co.za (8.11.0/8.11.0) with SMTP id g2QKPKQ26845; Tue, 26 Mar 2002 22:25:20 +0200 Message-ID: <000b01c1d503$27c62600$c80ba8c0@sabex.com> From: "PG Explorer" To: "Peter Atkins" , References: <02E689F991FFD311A75D009027B6A73E0886EAB1@corp_mail01.sf.nextcard.com> Subject: Re: Changeing Sequence Date: Tue, 26 Mar 2002 22:16:45 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 X-Archive-Number: 200203/348 X-Sequence-Number: 7222 When you play around with the sequence you violate the meaning of the word sequence But in any case in ver 7.2 you can use SELECT setval('mytqble_id_seq', 25); and the next value of the sequence will be 26 in older versions you can CREATE SEQUENCE 'mytqble_id_seq' START 25; or execute select nextval('mytqble_id_seq' ) 25 times http://www.pgexplorer.com Making PostgreSQL development a breeze ----- Original Message ----- From: "Peter Atkins" To: Sent: Tuesday, March 26, 2002 9:55 PM Subject: [SQL] Changeing Sequence > All, > > I have a table "mytable_id_seq" that looks like so. > > sequence_name | last_value | increment_by | max_value | > min_value | cache_value | log_cnt | is_cycled | is_called > ----------------------+------------+--------------+---------------------+- -- > --------+-------------+---------+-----------+----------- > mytqble_id_seq | 4 | 1 | 9223372036854775807 | > 1 | 1 | 30 | f | t > > > I have data that must be entered into the table "mytable" with pre-defined > ids (i.e. 1,3,5,7,25). Is it possible to change the sequence to start at > "26" the last value of the previous data? > > Please tell me YES! I get an error: "ERROR: You can't change sequence > relation t_staff_staff_id_seq" > > Any Help would be great! > > Thanks, > -pete > > ---------------------------(end of broadcast)--------------------------- > TIP 6: Have you searched our list archives? > > http://archives.postgresql.org