Re: DROP SEQUENCE ?

From: "imago" <imago(at)imago3d(dot)com>
To: "Ian deSouza" <iandesouza(at)earthlink(dot)net>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: DROP SEQUENCE ?
Date: 2001-01-08 20:15:28
Message-ID: 068a01c079b1$b5161730$c3869cd0@imago
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Are you using the right name for the sequence> I am very new to sql
so I might be off base here but the name of the sequence is:

<tablename>_<serialdatatypename>_id_seq

sql snippet

DROP TABLE members;
DROP
DROP SEQUENCE members_member_id_seq;
DROP

CREATE TABLE members (
member_id serial,
member_type VARCHAR(10),
username VARCHAR(20),
password VARCHAR(20),
prefix VARCHAR(10),
name_first VARCHAR(20),
name_last VARCHAR(20),
name_suffix VARCHAR(10),
address_street1 VAR CHAR(25),
address_street2 VAR CHAR(25),
address_city VARCHAR(20),
address_state VARCHAR(2),
address_zip VARCHAR(10),
phone VARCHAR(13),
email VARCHAR(30),
timedate_creation TIMESTAMP,
timedate_mod TIMESTAMP,
rating INTEGER,
preferences VARCHAR(100),
account_bal NUMERIC(16,2)
);
NOTICE: CREATE TABLE will create implicit sequence
'members_member_id_seq' for SERIAL column 'members.member_id'
NOTICE: CREATE TABLE/UNIQUE will create implicit index
'members_member_id_key' for table 'members'
CREATE

imago

----- Original Message -----
From: "Ian deSouza" <iandesouza(at)earthlink(dot)net>
To: <>
Sent: Friday, January 05, 2001 9:57 PM
Subject: [GENERAL] DROP SEQUENCE ?

> Anybody know the syntax of the DROP SEQUENCE sql statement for
PostgreSQL?
>
> Once I create a table with an attribute of type SERIAL, and drop
the table,
> I cannot recreate the table since the sequence already exists (and
DROP
> TABLE tableName does not remove the sequence entry). Does anybody
know what
> I would have to do to follow the DROP TABLE w/ to remove the
"sequence"
> created by the SERIAL datatype?
>
> Thanks in advance, Ian
>
>
>
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Mikheev, Vadim 2001-01-08 21:12:35 RE: replication followup
Previous Message Webb Sprague 2001-01-08 19:26:05 Tuning questions, and an offer