[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pgsql-bugs
Subject:    Re: BUG #14952: COPY fails to fill in IDENTITY column default value
From:       Michael Paquier <michael.paquier () gmail ! com>
Date:       2017-12-30 23:26:01
Message-ID: 20171230232601.GA4109 () paquier ! xyz
[Download RAW message or body]


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.
>=20
> 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

["signature.asc" (application/pgp-signature)]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic