Re: Function to execute a program - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Function to execute a program
Date
Msg-id 551809.1599923160@sss.pgh.pa.us
Whole thread Raw
In response to Function to execute a program  (Magnus Hagander <magnus@hagander.net>)
Responses Re: Function to execute a program
List pgsql-hackers
Magnus Hagander <magnus@hagander.net> 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 could then be parsed and processed as part of a query.
> Today, COPY FROM PROGRAM cannot do this, as we can't read a multiline json
> value with COPY.

copy ... from program 'random_json_producer | tr "\n\t" "  "';

I don't necessarily object to providing such a function to make it
easier, but it's not the case that you can't have the functionality
today.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Bharath Rupireddy
Date:
Subject: Re: Logical Replication - detail message with names of missing columns
Next
From: Magnus Hagander
Date:
Subject: Re: Function to execute a program