Re: identity columns - Mailing list pgsql-hackers

From Vitaly Burovoy
Subject Re: identity columns
Date
Msg-id CAKOSWN=jSR8oK96W1mARMpVs9NC5AjAgmKp=Ypfv4+Agj+qWYg@mail.gmail.com
Whole thread Raw
In response to Re: identity columns  (Vitaly Burovoy <vitaly.burovoy@gmail.com>)
List pgsql-hackers
On 4/4/17, Vitaly Burovoy <vitaly.burovoy@gmail.com> wrote:
> On 4/3/17, Peter Eisentraut <peter.eisentraut@2ndquadrant.com> wrote:
>> On 3/30/17 22:57, Vitaly Burovoy wrote:
>>> Why do you still want to leave "ADD IF NOT EXISTS" instead of using
>>> "SET IF NOT EXISTS"?
>>> If someone wants to follow the standard he can simply not to use "IF
>>> NOT EXISTS" at all. Without it error should be raised.
>>
>> As I tried to mention earlier, it is very difficult to implement the IF
>> NOT EXISTS behavior here, because we need to run the commands the create
>> the sequence before we know whether we will need it.
>
> I understand. You did not mention the reason.
> But now you have the "get_attidentity" function to check whether the
> column is an identity or not.
> If it is not so create a sequence otherwise skip the creation.
>
> I'm afraid after the feature freeze it is impossible to do "major
> reworking of things", but after the release we have to support the
> "ALTER COLUMN col ADD" grammar.

So it would be great if you have a time to get rid of "ALTER ... ADD
GENERATED" syntax in favor of "ALTER ... SET GENERATED ... IF NOT
EXIST"

> 3.
> It would be better if tab-completion has ability to complete the
> "RESTART" keyword like:
> ALTER TABLE x1 ALTER COLUMN i RESTART
> tab-complete.c:8898
> - COMPLETE_WITH_LIST5("TYPE", "SET", "RESET", "ADD", "DROP");
> + COMPLETE_WITH_LIST5("TYPE", "SET", "RESET", "RESTART", "ADD", "DROP");

Oops. Of course
+ COMPLETE_WITH_LIST6("TYPE", "SET", "RESET", "RESTART", "ADD", "DROP");

-- 
Best regards,
Vitaly Burovoy



pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: Logical replication and inheritance
Next
From: Peter Eisentraut
Date:
Subject: Re: increasing the default WAL segment size