Re: why generated columsn cannot be used in COPY TO?

Поиск
Список
Период
Сортировка
От Dominique Devienne
Тема Re: why generated columsn cannot be used in COPY TO?
Дата
Msg-id CAFCRh-86krUaoSJdnR0Gf5mDuXq=pAGkv1vdXHAoxpPHd5hFaQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: why generated columsn cannot be used in COPY TO?  (Rob Sargent <robjsargent@gmail.com>)
Список pgsql-general
On Fri, Oct 6, 2023 at 4:59 PM Rob Sargent <robjsargent@gmail.com> wrote:
What would be copied?  The formula?

Of course not. That's DDL, not DML IMHO.
 
Seems to me one is using “the fast option” so adding the column which can be regenerated is overhead.

Regenerated by whom?  COPY TO to is output to the outside world.
Nothing says it will come back to PostgreSQL later. COPY is not only for backups.
I use COPY to "stream" rows out for processing, combines the best of SELECT
and the incremental nature of CURSOR, for the best latency and throughput.

All that said, that's a work-around like Andreas showed.
I agree with Tom that ignoring them in the default list makes sense,
but that if explicitly asked for, they should be copied out. My $0.02.

В списке pgsql-general по дате отправления:

Предыдущее
От: "David G. Johnston"
Дата:
Сообщение: Re: why generated columsn cannot be used in COPY TO?
Следующее
От: Ron
Дата:
Сообщение: Re: why generated columsn cannot be used in COPY TO?