Re: Primary key constraints - Mailing list pgsql-novice

From Sean Davis
Subject Re: Primary key constraints
Date
Msg-id 002801c52370$91a6e370$1f6df345@WATSON
Whole thread Raw
In response to Primary key constraints  (Kumar S <ps_postgres@yahoo.com>)
List pgsql-novice
Kumar,

You can drop a sequence by doing:

drop sequence experiment_exp_id_seq;

See the documentation here:

http://www.postgresql.org/docs/8.0/static/sql-dropsequence.html

However, that should happen automatically if it was defined as a serial and
you dropped the table, so I'm not sure what is going on.  If the drop
sequence doesn't work, perhaps you could tell us what the table definition
for experiment used to look like and what your table def for study now looks
like.

Sean

----- Original Message -----
From: "Kumar S" <ps_postgres@yahoo.com>
To: <pgsql-novice@postgresql.org>
Sent: Monday, March 07, 2005 5:27 PM
Subject: [NOVICE] Primary key constraints


> Hi group,
>
>
> I removed a table from db names experiment.
> It has a primary key exp_id (experiment_exp_id_seq)
>
> I renamed that table to study. I re-created experiment
> table with all new column names.  exp_id
> (experiment_exp_id_seq) remains the primary key for
> this table.
>
> Now when I try to execute this table I get the
> following error:
>
> psql:/home/db/experiment.sql:10: ERROR:  relation
> "experiment_exp_id_seq" already exists
>
>
> How to remove this key from every where from the whole
> db.
>
> Thank you.
>
> K
>
>
>
>
> __________________________________
> Celebrate Yahoo!'s 10th Birthday!
> Yahoo! Netrospective: 100 Moments of the Web
> http://birthday.yahoo.com/netrospective/
>
> ---------------------------(end of broadcast)---------------------------
> TIP 7: don't forget to increase your free space map settings
>



pgsql-novice by date:

Previous
From: Kumar S
Date:
Subject: Primary key constraints
Next
From: Bearden Barnes
Date:
Subject: Re: [ADMIN] PostgreSQL installation problem on Windows XP Home