pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Justin Pryzby <pryzby@telsasoft.com>
To: Luc Vlaming <luc@swarm64.com>
Cc: Simon Riggs <simon@2ndquadrant.com>
Cc: Andres Freund <andres@anarazel.de>
Cc: pgsql-hackers@lists.postgresql.org, Heikki Linnakangas <hlinnaka@iki.fi>
Subject: Re: should INSERT SELECT use a BulkInsertState?
Date: Wed, 2 Dec 2020 10:53:51 -0600
Message-ID: <20201202165351.GG24052@telsasoft.com> (raw)
In-Reply-To: <20201130011146.GS24052@telsasoft.com>
References: <20200604173047.dirdp6zln7ogj54k@alap3.anarazel.de>
	<20200713015700.GA23581@telsasoft.com>
	<20200919133215.GB30557@telsasoft.com>
	<20201016210511.GC9241@telsasoft.com>
	<CANP8+jKmvtaq8a1YkKsfXpWOc3keN2k7K84Su+y--WZO6D_jFQ@mail.gmail.com>
	<20201030045138.GA3080@telsasoft.com>
	<bd0dc980-c4c9-29c9-8cb6-8d7787ae9fef@swarm64.com>
	<20201102184551.GJ22691@telsasoft.com>
	<20201124020020.GK24052@telsasoft.com>
	<20201130011146.GS24052@telsasoft.com>

One loose end in this patch is how to check for volatile default expressions.

copyfrom.c is a utility statement, so it can look at the parser's column list:
COPY table(c1,c2)...

However, for INSERT, in nodeModifyTable.c, it looks like parsing, rewriting,
and planning are done, at which point I don't know if there's a good way to
find that.  The default expressions will have been rewritten into the planned
statement.

We need the list of columns whose default is volatile, excluding columns for
which a non-default value is specified.

INSERT INTO table (c1,c2) VALUES (1,default);

We'd want the list of any column in the table with a volatile default,
excluding columns c1, but not-excluding explicit default columns c2 or any
implicit default columns (c3, etc).

Any idea ?

-- 
Justin





view thread (27+ messages)  latest in thread

Message-ID: <20201202165351.GG24052@telsasoft.com>
Permalink:  ../20201202165351.GG24052@telsasoft.com/
Also on:    postgresql.org/message-id/20201202165351.GG24052@telsasoft.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: pryzby@telsasoft.com, luc@swarm64.com, simon@2ndquadrant.com, andres@anarazel.de, hlinnaka@iki.fi
  Subject: Re: should INSERT SELECT use a BulkInsertState?
  In-Reply-To: <20201202165351.GG24052@telsasoft.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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