X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 8E20DD1B4EE for ; Thu, 25 Sep 2003 08:17:56 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 77505-06 for ; Thu, 25 Sep 2003 05:17:47 -0300 (ADT) Received: from coig.katowice.pl (pluton.coig.katowice.pl [217.98.68.8]) by svr1.postgresql.org (Postfix) with ESMTP id EB752D1B56B for ; Thu, 25 Sep 2003 05:17:44 -0300 (ADT) Received: from [217.98.68.20] (HELO Mariuszb) by coig.katowice.pl (CommuniGate Pro SMTP 3.5.9) with SMTP id 135955; Thu, 25 Sep 2003 10:17:44 +0200 Message-ID: <000501c3833d$63383ea0$930f10ac@win.coig.com> From: =?iso-8859-2?Q?Przemys=B3aw_S=B3upkowski?= To: "Lista dyskusyjna pgsql-sql" , "Richard Huxton" References: <005601c3832f$61fbcf60$930f10ac@win.coig.com> <200309250855.54588.dev@archonet.com> Subject: Re: Sequenties in pgSQL 7.3.x Date: Thu, 25 Sep 2003 10:16:57 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-2" Content-Transfer-Encoding: 8bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/301 X-Sequence-Number: 15279 HI Thanks for help I'm found this solution and this works, but I'm use something like that PERFORM setval(seq_name, value); It looks better but thanks a lot ----- Original Message ----- From: "Richard Huxton" To: "Przemysław Słupkowski" ; "Lista dyskusyjna pgsql-sql" Sent: Thursday, September 25, 2003 9:55 AM Subject: Re: [SQL] Sequenties in pgSQL 7.3.x On Thursday 25 September 2003 07:36, Przemysław Słupkowski wrote: > Hi > I am using postgresql 7.3.x. I am upgrating a database PostgreSQL. > The main problem is how to change field last value in sequencde which > exists in database. I created script to read this field and then I'm drop > the table, do modification and i'm must change this value to another value. > But DBMS returns me message like that > ERROR: You can't change sequence relation seq_id_seq > How to do this Are you using and UPDATE to set last_value? If so, you should use the setval() function instead. SELECT setval('my_seq', 1234); -- Richard Huxton Archonet Ltd ---------------------------(end of broadcast)--------------------------- TIP 7: don't forget to increase your free space map settings