Function to execute a program

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: PostgreSQL Developers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Function to execute a program
Date: 2020-09-12 13:12:02
Message-ID: CABUevEyx9fKur6nTmkycWNR4y0DYUEYj2gDrsRC8z5vjHC4GuA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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 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.

Thoughts?

//Magnus

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Magnus Hagander 2020-09-12 13:17:58 Re: Inconsistency in determining the timestamp of the db statfile.
Previous Message Amit Kapila 2020-09-12 11:49:24 Re: Inconsistency in determining the timestamp of the db statfile.