Re: DROP SEQUENCE ? - Mailing list pgsql-general

From imago
Subject Re: DROP SEQUENCE ?
Date
Msg-id 068a01c079b1$b5161730$c3869cd0@imago
Whole thread Raw
In response to DROP SEQUENCE ?  ("Ian deSouza" <iandesouza@earthlink.net>)
List 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@earthlink.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
>
>
>
>


pgsql-general by date:

Previous
From: Brian Troxell
Date:
Subject: SELECT INTO Troubles
Next
From: "elein"
Date:
Subject: hex input values