Creating then dropping primary key constraint

From: Havasvölgyi Ottó <h(dot)otto(at)freemail(dot)hu>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Creating then dropping primary key constraint
Date: 2005-12-05 00:37:44
Message-ID: 006201c5f934$1bcb2180$0200a8c0@OTTO
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

I noticed that when I create a primary key with ALTER TABLE ... ADD
CONSTRAINT ... PRIMARY KEY (...),
and then drop this constraint, then the "not null" modifier stays on the
column on which the primary key was defined although there were no
constraint on that column before.
Is this normal?
Pg 8.0.4

create table pritest(id integer);
\d pritest
alter table pritest add constraint pk_pritest primary key (id);
\d pritest
alter table pritest drop constraint pk_pritest;
\d pritest
drop table pritest;

Best regards,
Otto

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message vishal saberwal 2005-12-05 00:55:47 Selecting Large Object and TOAST
Previous Message Douglas McNaught 2005-12-04 21:07:55 Re: postgresql jdbc connect via hostname instead of just ip