Re: Function to execute a program

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Function to execute a program
Дата
Msg-id 1027425.1600094731@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Function to execute a program  (Stephen Frost <sfrost@snowman.net>)
Ответы Re: Function to execute a program  (Stephen Frost <sfrost@snowman.net>)
Список pgsql-hackers
Stephen Frost <sfrost@snowman.net> writes:
> * Magnus Hagander (magnus@hagander.net) wrote:
>> Would it make sense to have a pg_execute_program() that corresponds to COPY
>> FROM PROGRAM? This would obviously have the same permissions restrictions
>> as COPY FROM PROGRAM.

> I'd rather come up with a way to import this kind of object into PG by
> using COPY rather than adding a different way to pull them in.

I'm not for overloading COPY to try to make it handle every data import
use-case.  The issue here AIUI is that Magnus wants the program output
to be read as an uninterpreted blob (which he'll then try to convert to
jsonb or whatever, but that's not the concern of the import code).  This
is exactly antithetical to COPY's mission of reading some rows that are
made up of some columns and putting the result into a table.

Yeah, we could no doubt add some functionality to disable all the
row-splitting and column-splitting and associated escaping logic,
but that's going to make COPY slower and more complicated.  And it
still doesn't address wanting to use the result directly in a query
instead of sticking it into a table.

            regards, tom lane



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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: pg_restore causing deadlocks on partitioned tables
Следующее
От: Domagoj Smoljanovic
Дата:
Сообщение: RE: pg_restore causing deadlocks on partitioned tables