pg.ddx.io pgsql-hackers@postgresql.org mailing list archive
help / color / mirror / Atom feedFrom: Álvaro Herrera <alvherre@alvh.no-ip.org>
To: Masahiko Sawada <sawada.mshk@gmail.com>
Cc: Vladlen Popolitov <v.popolitov@postgrespro.ru>
Cc: Sutou Kouhei <kou@clear-code.com>
Cc: zhjwpku@gmail.com
Cc: michael@paquier.xyz
Cc: pgsql-hackers@postgresql.org
Subject: Re: Make COPY format extendable: Extract COPY TO format implementations
Date: Wed, 5 Feb 2025 20:26:20 +0100
Message-ID: <202502051926.sqnaa24c4vp7@alvherre.pgsql> (raw)
In-Reply-To: <CAD21AoD0kas6yL_D6oF6ErNxTqiOo1-h=Ym1DuA5RYJF25YSWw@mail.gmail.com>
On 2025-Feb-05, Masahiko Sawada wrote:
> I think that the patch needs to check if the function's result type is
> COPY_HANDLEROID by using get_func_rettype(), before calling it. But
> with this check, we can prevent arbitrary functions from being called
> via COPY. Why do we need to extend CREATE ACCESS METHOD too for that
> purpose?
It's a nicer UI than a bare CREATE FUNCTION, but perhaps it is overkill.
IIRC the reason we require CREATE ACCESS METHOD for table AMs is so that
we acquire a pg_am entry with an OID that can be referenced from
elsewhere, for instance you can't drop an AM if tables are using it; but
you can't use COPY in rules or anything like that that's going to be
stored permanently. Perhaps you're right that we don't need this for
extensible COPY FORMAT.
--
Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/
view thread (340+ messages) latest in thread
Message-ID: <202502051926.sqnaa24c4vp7@alvherre.pgsql>
Permalink: ../202502051926.sqnaa24c4vp7@alvherre.pgsql/
Also on: postgresql.org/message-id/202502051926.sqnaa24c4vp7@alvherre.pgsql
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: alvherre@alvh.no-ip.org, sawada.mshk@gmail.com, v.popolitov@postgrespro.ru, kou@clear-code.com, zhjwpku@gmail.com, michael@paquier.xyz
Subject: Re: Make COPY format extendable: Extract COPY TO format implementations
In-Reply-To: <202502051926.sqnaa24c4vp7@alvherre.pgsql>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox