Re: [HACKERS] [PATCH] WIP Add ALWAYS DEFERRED option for constraints - Mailing list pgsql-hackers

From Nico Williams
Subject Re: [HACKERS] [PATCH] WIP Add ALWAYS DEFERRED option for constraints
Date
Msg-id 20171003202236.GP1251@localhost
Whole thread Raw
In response to Re: [HACKERS] [PATCH] WIP Add ALWAYS DEFERRED option forconstraints  (Andreas Joseph Krogh <andreas@visena.com>)
List pgsql-hackers
On Tue, Oct 03, 2017 at 10:10:59PM +0200, Andreas Joseph Krogh wrote:
> +1.
> 
> While we're in deferrable constraints land...;  I even more often need 
> deferrable conditional unique-indexes.
> In PG you now may have:
> ALTER TABLE email_folder ADD CONSTRAINT some_uk UNIQUE (owner_id, folder_type, 
> name) DEFERRABLE INITIALLY DEFERRED; 
> 
> But this isn't supported:
> CREATE UNIQUE INDEX some_uk ON email_folder(owner_id, folder_type, name) WHERE 
> parent_id IS NULL DEFERRABLE INITIALLY DEFERRED;
> 
> Are there any plans to support this?

Not by me, but I can take a look and, if it is trivial, do it.  At a
quick glance it does look like it should be easy enough to do it, at
least to get started on a patch.  

If I can get some help with my current patch, I'll take a look :)

But yes, I'd like to have full consistency between CREATE and ALTER.
Everything that one can do with CREATE should be possible to do with
ALTER, including IF NOT EXISTS.

Nico
-- 


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

pgsql-hackers by date:

Previous
From: Andreas Joseph Krogh
Date:
Subject: Re: [HACKERS] [PATCH] WIP Add ALWAYS DEFERRED option forconstraints
Next
From: Andrew Dunstan
Date:
Subject: Re: [HACKERS] datetime.h defines like PM conflict with externallibraries