IDENTITY/GENERATED v36 Re: Final version of IDENTITY/GENERATED patch - Mailing list pgsql-patches

From Zoltan Boszormenyi
Subject IDENTITY/GENERATED v36 Re: Final version of IDENTITY/GENERATED patch
Date
Msg-id 45EA11F0.6090301@dunaweb.hu
Whole thread Raw
In response to Re: Final version of IDENTITY/GENERATED patch  (Bruce Momjian <bruce@momjian.us>)
Responses Re: IDENTITY/GENERATED v36 Re: Final version of IDENTITY/GENERATED patch
Re: IDENTITY/GENERATED v36 Re: Final version of IDENTITY/GENERATED patch
List pgsql-patches
Hi

Bruce Momjian írta:
> Zoltan Boszormenyi wrote:
>
>> Hi!
>>
>> Thanks.
>>
>> However, in the meantime I made some changes
>> so the IDENTITY column only advances its sequence
>> if it fails its CHECK constraints or UNIQUE indexes.
>> I still have some work with expression indexes.
>> Should I post an incremental patch against this version
>> or a full patch when it's ready?
>>
>
> Full patch.
>

Then here it is. Now it's really finished, I promise. :-)
Changes:

- unique index checks are done in two steps
  to avoid inflating the sequence if a unique index check
  is failed that doesn't reference the IDENTITY column
- to minimize runtime impact of checking whether
  an index references the IDENTITY column and skipping it
  in the first step in ExecInsertIndexTuples(), I introduced
  a new attribute in the pg_index catalog. I had to place it
  in the middle of the fixed size attributes because I had
  mysterious crashes otherwise. This means the attributes
  are renumbered. This attribute is determined during
  CREATE INDEX and recomputed for all indexes defined
  on the table during ALTER TABLE SET/DROP IDENTITY.
- as a consequence, IDENTITY/GENERATED can now
  have CHECK constraints, this limit was removed.
- modified testcase for the above changes
- reworded documentation

Please, review.

Best regards,
Zoltán Böszörményi


Attachment

pgsql-patches by date:

Previous
From: Neil Conway
Date:
Subject: Re: cosmetic patch to large object regression test
Next
From: Bruce Momjian
Date:
Subject: Re: IDENTITY/GENERATED v36 Re: Final version of IDENTITY/GENERATED patch