Re: Function to execute a program

2020-09-14 Thread Stephen Frost
Greetings. * Tom Lane (t...@sss.pgh.pa.us) wrote: > Stephen Frost writes: > > * Magnus Hagander (mag...@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

Re: Function to execute a program

2020-09-14 Thread Tom Lane
Stephen Frost writes: > * Magnus Hagander (mag...@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 thi

Re: Function to execute a program

2020-09-14 Thread Stephen Frost
Greetings, * Magnus Hagander (mag...@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. Eh, perhaps. > The usecase would be to for example execute a

Re: Function to execute a program

2020-09-12 Thread Andrew Dunstan
On 9/12/20 11:11 AM, Magnus Hagander wrote: > > > On Sat, Sep 12, 2020 at 5:06 PM Tom Lane > wrote: > > Magnus Hagander mailto:mag...@hagander.net>> > writes: > > Would it make sense to have a pg_execute_program() that > corresponds to COPY > > FROM

Re: Function to execute a program

2020-09-12 Thread Magnus Hagander
On Sat, Sep 12, 2020 at 5:06 PM Tom Lane wrote: > Magnus Hagander writes: > > 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. > > The usecase would be to for exam

Re: Function to execute a program

2020-09-12 Thread Tom Lane
Magnus Hagander writes: > 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. > The usecase would be to for example execute a command that returns json > format output, which

Function to execute a program

2020-09-12 Thread Magnus Hagander
Today we have pg_read_file() and pg_read_binary_file(), which mostly correspond to COPY from a file, but reads a whole (or parts but based on bytes) into a single value rather than rows. Would it make sense to have a pg_execute_program() that corresponds to COPY FROM PROGRAM? This would obviously