pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feeddrop constraint primary key
2+ messages / 2 participants
[nested] [flat]
* drop constraint primary key
@ 2002-10-03 16:06 Marie G. Tuite <marie.tuite@edisonaffiliates.com>
2002-10-03 17:09 ` Re: drop constraint primary key Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 2+ messages in thread
From: Marie G. Tuite @ 2002-10-03 16:06 UTC (permalink / raw)
To: pgsql-sql
project=# select version();
version
-------------------------------------------------------------
PostgreSQL 7.2.1 on i686-pc-linux-gnu, compiled by GCC 2.96
(1 row)
Running above, am trying to drop the primary key, but get the follwing
error.
project=# alter table class_teacher_rlt drop constraint
class_teacher_rlt_pkey restrict;
ERROR: ALTER TABLE / DROP CONSTRAINT: class_teacher_rlt_pkey does not exist
project=# \d class_teacher_rlt
Table "class_teacher_rlt"
Column | Type | Modifiers
----------------------+--------------------------+--------------------------
--
class_id | integer | not null
user_id | integer | not null
school_id | integer | not null
start_date | timestamp with time zone | not null default now()
end_date | timestamp with time zone |
class_action_type_id | integer | not null default 1
action_detail | character varying(100) |
teacher_role_id | integer |
ind_prim_teacher | boolean | not null default
'f'::bool
ind_lead_teacher | boolean | default 'f'
status_id | integer | default 1
created_date | timestamp with time zone | not null default 'now'
last_modified | timestamp with time zone |
Primary key: class_teacher_rlt_pkey
Any ideas?
Thanks.
Marie
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: drop constraint primary key
2002-10-03 16:06 drop constraint primary key Marie G. Tuite <marie.tuite@edisonaffiliates.com>
@ 2002-10-03 17:09 ` Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 0 replies; 2+ messages in thread
From: Tom Lane @ 2002-10-03 17:09 UTC (permalink / raw)
To: marie.tuite@edisonaffiliates.com; +Cc: pgsql-sql
"Marie G. Tuite" <marie.tuite@edisonaffiliates.com> writes:
> Running above, am trying to drop the primary key, but get the follwing
> error.
> project=# alter table class_teacher_rlt drop constraint
> class_teacher_rlt_pkey restrict;
> ERROR: ALTER TABLE / DROP CONSTRAINT: class_teacher_rlt_pkey does not exist
In 7.2 DROP CONSTRAINT only works for CHECK-type constraints; you'll
have to drop the underlying index directly to get rid of a
primary-key-type constraint.
7.3 does allow DROP CONSTRAINT for this.
regards, tom lane
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2002-10-03 17:09 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2002-10-03 16:06 drop constraint primary key Marie G. Tuite <marie.tuite@edisonaffiliates.com>
2002-10-03 17:09 ` Tom Lane <tgl@sss.pgh.pa.us>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox