Re: Change a constraint's index - ALTER TABLE ... ALTER CONSTRAINT ... USING INDEX ... - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: Change a constraint's index - ALTER TABLE ... ALTER CONSTRAINT ... USING INDEX ...
Date
Msg-id 20200908145618.GA14279@alvherre.pgsql
Whole thread Raw
In response to Re: Change a constraint's index - ALTER TABLE ... ALTER CONSTRAINT ... USING INDEX ...  (Laurenz Albe <laurenz.albe@cybertec.at>)
List pgsql-hackers
On 2020-Sep-08, Laurenz Albe wrote:

> We should at least have
> 
>   ALTER TABLE ... ADD PRIMARY KEY (id) INCLUDE (val);
> 
> or something before we consider this patch.

Agreed.

Now the trick in this new command is to let the user change the included
columns afterwards, which remains useful (since it's clearly reasonable
to change minds after applications using the constraint start to take
shape).

> As to the information_schema, that could pretend that the INCLUDE
> columns just don't exist.

Yeah, that's what I was thinking too, since for all intents and
purposes, from the standard's POV the constraint works the same
regardless of included columns.

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



pgsql-hackers by date:

Previous
From: Laurenz Albe
Date:
Subject: Re: Change a constraint's index - ALTER TABLE ... ALTER CONSTRAINT ... USING INDEX ...
Next
From: Pavel Stehule
Date:
Subject: Re: proposal - reference to plpgsql_check from plpgsql doc