Re: Primary key constraints

From: "Sean Davis" <sdavis2(at)mail(dot)nih(dot)gov>
To: "Kumar S" <ps_postgres(at)yahoo(dot)com>, <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Primary key constraints
Date: 2005-03-07 23:51:17
Message-ID: 002801c52370$91a6e370$1f6df345@WATSON
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)yahoo(dot)com>
To: <pgsql-novice(at)postgresql(dot)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
>

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message NetSuporte 2005-03-08 01:59:07 QT3 Designer Pgadmin III and PgAccess Cannot connect to PostgreSQL 7.4 database
Previous Message Kumar S 2005-03-07 22:27:56 Primary key constraints