Dropping CHECK constraints

Started by Christopher Kings-Lynnealmost 25 years ago4 messages
#1Christopher Kings-Lynne
chriskl@familyhealth.com.au

In 7.0.3, is it safe to drop a check constraint by simply deleting it from
the pg_relcheck table?

Chris

--
Christopher Kings-Lynne
Family Health Network (ACN 089 639 243)

#2Christopher Kings-Lynne
chriskl@familyhealth.com.au
In reply to: Christopher Kings-Lynne (#1)
RE: Dropping CHECK constraints

OK, I notice I have to decrement the reltriggers field in the pg_class
directory as well, but other than that is there any problem?

Chris

Show quoted text

-----Original Message-----
From: pgsql-hackers-owner@postgresql.org
[mailto:pgsql-hackers-owner@postgresql.org]On Behalf Of Christopher
Kings-Lynne
Sent: Monday, March 19, 2001 10:53 AM
To: Hackers
Subject: [HACKERS] Dropping CHECK constraints

In 7.0.3, is it safe to drop a check constraint by simply deleting it from
the pg_relcheck table?

Chris

--
Christopher Kings-Lynne
Family Health Network (ACN 089 639 243)

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly

#3Christopher Kings-Lynne
chriskl@familyhealth.com.au
In reply to: Christopher Kings-Lynne (#1)
RE: Dropping CHECK constraints

Doh! Not reltriggers - I meant relchecks...

Chris

Show quoted text

-----Original Message-----
From: pgsql-hackers-owner@postgresql.org
[mailto:pgsql-hackers-owner@postgresql.org]On Behalf Of Christopher
Kings-Lynne
Sent: Monday, March 19, 2001 10:53 AM
To: Hackers
Subject: [HACKERS] Dropping CHECK constraints

In 7.0.3, is it safe to drop a check constraint by simply deleting it from
the pg_relcheck table?

Chris

--
Christopher Kings-Lynne
Family Health Network (ACN 089 639 243)

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly

#4Tom Lane
tgl@sss.pgh.pa.us
In reply to: Christopher Kings-Lynne (#1)
Re: Dropping CHECK constraints

"Christopher Kings-Lynne" <chriskl@familyhealth.com.au> writes:

In 7.0.3, is it safe to drop a check constraint by simply deleting it from
the pg_relcheck table?

You'll need to adjust the relchecks count in the table's pg_class entry
as well.

regards, tom lane