pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Allow a multi-row INSERT to specify DEFAULTs for a generated col
3+ messages / 2 participants
[nested] [flat]

* pgsql: Allow a multi-row INSERT to specify DEFAULTs for a generated col
@ 2020-11-22 20:48 Tom Lane <tgl@sss.pgh.pa.us>
  2021-08-19 03:14 ` Re: pgsql: Allow a multi-row INSERT to specify DEFAULTs for a generated col Laurenz Albe <laurenz.albe@cybertec.at>
  0 siblings, 1 reply; 3+ messages in thread

From: Tom Lane @ 2020-11-22 20:48 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Allow a multi-row INSERT to specify DEFAULTs for a generated column.

One can say "INSERT INTO tab(generated_col) VALUES (DEFAULT)" and not
draw an error.  But the equivalent case for a multi-row VALUES list
always threw an error, even if one properly said DEFAULT in each row.
Fix that.  While here, improve the test cases for nearby logic about
OVERRIDING SYSTEM/USER values.

Dean Rasheed

Discussion: https://postgr.es/m/9q0sgcr416t.fsf@gmx.us

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/17958972fe3bb03454a4b53756b29d65dc285efa

Modified Files
--------------
src/backend/rewrite/rewriteHandler.c    | 242 ++++++++++++++++++++++++++++----
src/test/regress/expected/generated.out |  47 ++++++-
src/test/regress/expected/identity.out  |  56 ++++++++
src/test/regress/sql/generated.sql      |  21 ++-
src/test/regress/sql/identity.sql       |  23 +++
5 files changed, 357 insertions(+), 32 deletions(-)



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: pgsql: Allow a multi-row INSERT to specify DEFAULTs for a generated col
  2020-11-22 20:48 pgsql: Allow a multi-row INSERT to specify DEFAULTs for a generated col Tom Lane <tgl@sss.pgh.pa.us>
@ 2021-08-19 03:14 ` Laurenz Albe <laurenz.albe@cybertec.at>
  2021-08-19 03:17   ` Re: pgsql: Allow a multi-row INSERT to specify DEFAULTs for a generated col Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 3+ messages in thread

From: Laurenz Albe @ 2021-08-19 03:14 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; pgsql-committers@lists.postgresql.org

On Sun, 2020-11-22 at 20:48 +0000, Tom Lane wrote:
> Allow a multi-row INSERT to specify DEFAULTs for a generated column.
> 
> One can say "INSERT INTO tab(generated_col) VALUES (DEFAULT)" and not
> draw an error.  But the equivalent case for a multi-row VALUES list
> always threw an error, even if one properly said DEFAULT in each row.
> Fix that.  While here, improve the test cases for nearby logic about
> OVERRIDING SYSTEM/USER values.
> 
> Dean Rasheed
> 
> Discussion: https://postgr.es/m/9q0sgcr416t.fsf@gmx.us
> 
> Branch
> ------
> master
> 
> Details
> -------
> https://git.postgresql.org/pg/commitdiff/17958972fe3bb03454a4b53756b29d65dc285efa

Shouldn't this be backpatched?
That seems like a clear bug to me; see this report on v11:
https://stackoverflow.com/q/68834080/6464308

Yours,
Laurenz Albe






^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: pgsql: Allow a multi-row INSERT to specify DEFAULTs for a generated col
  2020-11-22 20:48 pgsql: Allow a multi-row INSERT to specify DEFAULTs for a generated col Tom Lane <tgl@sss.pgh.pa.us>
  2021-08-19 03:14 ` Re: pgsql: Allow a multi-row INSERT to specify DEFAULTs for a generated col Laurenz Albe <laurenz.albe@cybertec.at>
@ 2021-08-19 03:17   ` Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 3+ messages in thread

From: Tom Lane @ 2021-08-19 03:17 UTC (permalink / raw)
  To: Laurenz Albe <laurenz.albe@cybertec.at>; +Cc: pgsql-committers@lists.postgresql.org

Laurenz Albe <laurenz.albe@cybertec.at> writes:
> On Sun, 2020-11-22 at 20:48 +0000, Tom Lane wrote:
>> Allow a multi-row INSERT to specify DEFAULTs for a generated column.

> Shouldn't this be backpatched?
> That seems like a clear bug to me; see this report on v11:
> https://stackoverflow.com/q/68834080/6464308

https://www.postgresql.org/message-id/flat/CAEMmGb5BN_iRabOKO1_G6LkecxqLHrwFQ%3DcuN1bJC4HmUsjjLw%40m...

			regards, tom lane





^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2021-08-19 03:17 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-11-22 20:48 pgsql: Allow a multi-row INSERT to specify DEFAULTs for a generated col Tom Lane <tgl@sss.pgh.pa.us>
2021-08-19 03:14 ` Laurenz Albe <laurenz.albe@cybertec.at>
2021-08-19 03:17   ` Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox