Re: alter table..drop constraint pkey, left not null un-dropped

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Rajkumar Raghuwanshi <rajkumar(dot)raghuwanshi(at)enterprisedb(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: alter table..drop constraint pkey, left not null un-dropped
Date: 2017-05-11 12:44:43
Message-ID: 28820.1494506683@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Rajkumar Raghuwanshi <rajkumar(dot)raghuwanshi(at)enterprisedb(dot)com> writes:
> I have created a table with primary key, and then dropped primary key from
> table. But table still have not null constraint added by primary key.

> Is there any other statement to delete primary key with not null?
> or this is an expected behaviour of pg?

Yes, it's expected. You can use "alter table t alter column c drop not
null" if you don't want the not-null constraint anymore.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeevan Ladhe 2017-05-11 12:50:04 Re: Bug in pg_dump --table and --exclude-table for declarative partition table handling.
Previous Message tushar 2017-05-11 12:25:02 If subscription to foreign table valid ?