Re: creating CHECK constraints as NOT VALID

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Thom Brown <thom(at)linux(dot)com>
Cc: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: creating CHECK constraints as NOT VALID
Date: 2011-06-02 16:48:42
Message-ID: 1307033061-sup-51@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Excerpts from Alvaro Herrera's message of mié jun 01 20:56:12 -0400 2011:
> Excerpts from Thom Brown's message of mié jun 01 19:48:44 -0400 2011:
>
> > Is this expected?
> > [ pg_dump fails to preserve not-valid status of constraints ]
>
> Certainly not.
>
> > Shouldn't the constraint be dumped as not valid too??
>
> Sure, I'll implement that tomorrow.

Actually, it turns out that NOT VALID foreign keys were already buggy
here, and fixing them automatically fixes this case as well, because the
fix involves touching pg_get_constraintdef to dump the flag. This also
gets it into psql's \d. Patch attached.

(Maybe the changes in psql's describe.c should be reverted, not sure.)

--
Álvaro Herrera <alvherre(at)commandprompt(dot)com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

Attachment Content-Type Size
0001-Fix-pg_get_constraintdef-to-cope-with-NOT-VALID-cons.patch application/octet-stream 1.0 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2011-06-02 16:50:22 Re: pgpool versus sequences
Previous Message Marko Kreen 2011-06-02 16:47:44 Re: Please test peer (socket ident) auth on *BSD