pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Rob Sargent <robjsargent@gmail.com>
To: pgsql-general <pgsql-general@lists.postgresql.org>
Subject: Re: why generated columsn cannot be used in COPY TO?
Date: Fri, 6 Oct 2023 08:55:24 -0600
Message-ID: <8C3C0E91-3515-4E51-8932-1ABE6CE57977@gmail.com> (raw)
In-Reply-To: <2949797.1696600071@sss.pgh.pa.us>
References: <CAKoxK+5=P6wJw=_UrzAQOBnGiHuq3kaXuPxuFh9_hTQc4nv89Q@mail.gmail.com>
	<2949797.1696600071@sss.pgh.pa.us>



> On Oct 6, 2023, at 7:47 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> 
> Luca Ferrari <fluca1978@gmail.com> writes:
>> I'm wondering why in COPY TO (file or program) I cannot use generated
>> columns: since I'm pushing data out of the table, why they are not
>> allowed?
> 
> There's a comment about that in copy.c:
> 
> * We don't include generated columns in the generated full list and we don't
> * allow them to be specified explicitly.  They don't make sense for COPY
> * FROM, but we could possibly allow them for COPY TO.  But this way it's at
> * least ensured that whatever we copy out can be copied back in.
> 
> Not sure how convincing that reasoning is, but it was at least
> thought about.  I do agree with it as far as the default column
> list goes, but maybe we could allow explicit selection of these
> columns in COPY TO.
> 
> 			regards, tom lane
> 
> 
What would be copied?  The forumla? Seems to me one is using “the fast option” so adding the column which can be regenerated is overhead.






view thread (14+ messages)  latest in thread

Message-ID: <8C3C0E91-3515-4E51-8932-1ABE6CE57977@gmail.com>
Permalink:  ../8C3C0E91-3515-4E51-8932-1ABE6CE57977@gmail.com/
Also on:    postgresql.org/message-id/8C3C0E91-3515-4E51-8932-1ABE6CE57977@gmail.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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: robjsargent@gmail.com
  Subject: Re: why generated columsn cannot be used in COPY TO?
  In-Reply-To: <8C3C0E91-3515-4E51-8932-1ABE6CE57977@gmail.com>
  References: <CAKoxK+5=P6wJw=_UrzAQOBnGiHuq3kaXuPxuFh9_hTQc4nv89Q@mail.gmail.com> <2949797.1696600071@sss.pgh.pa.us> <8C3C0E91-3515-4E51-8932-1ABE6CE57977@gmail.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