X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 1D089D1DA83 for ; Mon, 16 Feb 2004 18:17:32 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 32844-09 for ; Mon, 16 Feb 2004 14:17:25 -0400 (AST) Received: from news.hub.org (news.hub.org [200.46.204.72]) by svr1.postgresql.org (Postfix) with ESMTP id 69871D1DA97 for ; Mon, 16 Feb 2004 14:17:24 -0400 (AST) Received: from news.hub.org (news.hub.org [200.46.204.72]) by news.hub.org (8.12.9/8.12.9) with ESMTP id i1GIHK1Y096820 for ; Mon, 16 Feb 2004 18:17:20 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id i1GHqeqw092052 for pgsql-sql@postgresql.org; Mon, 16 Feb 2004 17:52:40 GMT From: "Greg Patnude" X-Newsgroups: comp.databases.postgresql.sql Subject: Re: nextval problem Date: Mon, 16 Feb 2004 09:51:46 -0800 Organization: Hub.Org Networking Services Lines: 45 Message-ID: References: X-Complaints-To: usenet@news.hub.org X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 To: pgsql-sql@postgresql.org X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200402/220 X-Sequence-Number: 16910 New feature for posgreSQL 7.3 & later -- sequences are automatically dropped when the owning table is dropped -- you need to recreate the sequence.... The easiest way is in your CREATE TABLE tblName ( id serial PRIMARY KEY, blah..., blah..., ) WITH OIDS; -- Greg Patnude / The Digital Demention 2916 East Upper Hayden Lake Road Hayden Lake, ID 83835 (208) 762-0762 "Ivo Anon" wrote in message news:h7WWb.13725$2Z2.1853@amsnews05.chello.com... > I'm new to postgresql and I'm having problems with the 'nextval' function > (or whatever it is called in postgresql). > > I created a table (called ADDRESS) using 'pgadmin' which has a serial field > (called addressid). When I tried the sql statement: > > select nextval('public."ADDRESS_addressid_seq"') > > everything seemed to be working fine. > > I then used the create table statement (displayed in pgadmin when the table > 'ADDRESS' is selected) to create the same table (of course after first > dropping 'ADDRESS'). When I try the same select-statement I suddenly got an > error message saying: > > ERROR: Relation "public"."ADDRESS_addressid_seq" does not exist > > Can anybody help me with this problem? > >