Thread: Dropping CHECK constraints

Dropping CHECK constraints

From
"Christopher Kings-Lynne"
Date:
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)



RE: Dropping CHECK constraints

From
"Christopher Kings-Lynne"
Date:
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

> -----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
>



RE: Dropping CHECK constraints

From
"Christopher Kings-Lynne"
Date:
Doh! Not reltriggers - I meant relchecks...

Chris

> -----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
>



Re: Dropping CHECK constraints

From
Tom Lane
Date:
"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