Re: nextval problem

From: "Greg Patnude" <gpatnude(at)hotmail(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: nextval problem
Date: 2004-02-16 17:51:46
Message-ID: c0r018$2psh$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice pgsql-sql

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" <ivoa72(at)hotmail(dot)com> wrote in message
news:h7WWb(dot)13725$2Z2(dot)1853(at)amsnews05(dot)chello(dot)com(dot)(dot)(dot)
> 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?
>
>

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Maximilian Tyrtania 2004-02-17 08:20:56 Moving from Openbase to Postgres
Previous Message joseph speigle 2004-02-16 17:12:56 Re: PostgreSQL From xinit

Browse pgsql-sql by date

  From Date Subject
Next Message Kumar 2004-02-17 05:10:19 Re: Getting the week of a date
Previous Message Stephan Szabo 2004-02-16 17:39:42 Re: Function