Re: why generated columsn cannot be used in COPY TO? - Mailing list pgsql-general

From Tom Lane
Subject Re: why generated columsn cannot be used in COPY TO?
Date
Msg-id 2970696.1696610245@sss.pgh.pa.us
Whole thread Raw
In response to Re: why generated columsn cannot be used in COPY TO?  ("David G. Johnston" <david.g.johnston@gmail.com>)
Responses Re: why generated columsn cannot be used in COPY TO?
List pgsql-general
"David G. Johnston" <david.g.johnston@gmail.com> writes:
>> On 10/6/23 08:45, Ron wrote:
>>> Nah.  "The programmer -- and DBA -- on the Clapham omnibus" quite
>>> reasonably expects that COPY table_name TO (output)" copies all the
>>> columns listed in "\d table_name".

> Sure, but it doesn't.  Mainly since copy's original design was intended to
> solve the dump/restore problem and it doesn't make sense to specify data
> for inbound generated data.  So while we do have a POLA violation here the
> desirability to now fix it years later is basically zero.  And the current
> behavior is at least defensible and consistent.  And there is a very easy
> way to get the desired output making any change that much harder a sell.

Changing the default behavior now is certainly a non-starter.
I don't really see any backwards-compatibility problem with
allowing cases that had been errors, though.

            regards, tom lane



pgsql-general by date:

Previous
From: Ron
Date:
Subject: Re: why generated columsn cannot be used in COPY TO?
Next
From: "David G. Johnston"
Date:
Subject: Re: why generated columsn cannot be used in COPY TO?