Re: BUG #14952: COPY fails to fill in IDENTITY column default value - Mailing list pgsql-bugs

From Michael Paquier
Subject Re: BUG #14952: COPY fails to fill in IDENTITY column default value
Date
Msg-id 20171230232601.GA4109@paquier.xyz
Whole thread Raw
In response to Re: BUG #14952: COPY fails to fill in IDENTITY column default value  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: BUG #14952: COPY fails to fill in IDENTITY column default value  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
List pgsql-bugs
On Wed, Dec 27, 2017 at 03:43:05PM -0500, Tom Lane wrote:
> Peter Eisentraut <peter.eisentraut@2ndquadrant.com> writes:
>> That doesn't work because for the
>> identity case we don't store the expression in the catalog.  The
>> proposed patch works by storing the sequence *name* in the internal
>> structures so that it can be used in place of the stored default value.
>
> I trust you really mean you're storing an OID ...

A RangeVar is used for the proposed patch 0002. Still does it matter? In
the scenario proposed here, which is to fix ALTER TABLE ADD COLUMN
GENERATED, then the sequence gets created and visible only once the
transaction adding the column has been created.

     char        identity;        /* attidentity setting */
+    RangeVar   *identitySequence;
     CollateClause *collClause;    /* untransformed COLLATE spec, if any */
It mat be better to tell that this is used to create a sequence in the
same transaction as the one doing the parsing.
--
Michael

Attachment

pgsql-bugs by date:

Previous
From: Devrim Gündüz
Date:
Subject: Re: BUG #14995: repmgr_funcs lib is missing in rpm
Next
From: Amit Kapila
Date:
Subject: Re: 10.1: hash index size exploding on vacuum full analyze