Re: [PATCH] Add ALWAYS DEFERRED option for constraints

From: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
To: Nico Williams <nico(at)cryptonector(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [PATCH] Add ALWAYS DEFERRED option for constraints
Date: 2017-11-02 20:20:19
Message-ID: 6ae312d4-d3b2-a999-cb15-91a028229c86@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I haven't really thought about this feature too hard; I just want to
give you a couple of code comments.

I think the catalog structure, and relatedly also the parser structures,
could be made more compact. We currently have condeferrable and
condeferred to represent three valid states (NOT DEFERRABLE, DEFERRABLE
INITIALLY IMMEDIATE, DEFERRABLE INITIALLY DEFERRED). You are adding
conalwaysdeferred, but you are adding only additional state (ALWAYS
DEFERRED). So we end up with three bool fields to represent four
states. I think this should all be rolled into one char field with four
states.

In psql and pg_dump, if you are query new catalog fields, you need to
have a version check to have a different query for >=PG11. (This would
likely apply whether you adopt my suggestion above or not.)

Maybe a test case in pg_dump would be useful.

Other than that, this looks like a pretty complete patch.

--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Nico Williams 2017-11-02 20:32:24 Re: MERGE SQL Statement for PG11
Previous Message Alvaro Herrera 2017-11-02 20:11:16 Re: Re: PANIC: invalid index offnum: 186 when processing BRIN indexes in VACUUM