Is there a way to run heap_insert() AFTER ExecInsertIndexTuples() ? - Mailing list pgsql-hackers

From Zoltan Boszormenyi
Subject Is there a way to run heap_insert() AFTER ExecInsertIndexTuples() ?
Date
Msg-id 45E65E90.3070401@dunaweb.hu
Whole thread Raw
Responses Re: Is there a way to run heap_insert() AFTER ExecInsertIndexTuples() ?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Hi,

I would like to be able to harden the conditions
of generating IDENTITY columns so the
events below run in this order:

- assign values for regular columns (with or without DEFAULT)
- NOT NULL checks on regular columns
- CHECK constraints whose expression contains only regular columns

- assign values for GENERATED columns
- NOT NULL checks on GENERATED columns
- CHECK constraints whose expression may contain regular or GENERATED columns

- UNIQUE index checks that has only regular columns
- UNIQUE index checks that may have regular or GENERATED columns

- assign values for IDENTITY column
- NOT NULL on IDENTITY
- CHECK constraints on IDENTITY
- UNIQUE index checks that can reference IDENTITY column

At this point the heap tuple and the index tuple can be inserted
without further checks.

Currently tuple->t_self is required by ExecInsertIndexTuples()
and I don't see any way to make IDENTITY work the way it's
intended but to mix heap_insert()/heap_update() and
ExecInsertIndexTuples() together and use the result in
ExecInsert() and ExecUpdate().

Would it be acceptable?

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



pgsql-hackers by date:

Previous
From: Galy Lee
Date:
Subject: Re: Resumable vacuum proposal and design overview
Next
From: "Jonah H. Harris"
Date:
Subject: Re: COMMIT NOWAIT Performance Option