public inbox for [email protected]  
help / color / mirror / Atom feed
From: Vladlen Popolitov <[email protected]>
To: Álvaro Herrera <[email protected]>
Cc: Sutou Kouhei <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Subject: Re: Make COPY format extendable: Extract COPY TO format implementations
Date: Wed, 05 Feb 2025 22:26:14 +0700
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>

Álvaro Herrera писал(а) 2025-02-05 18:49:
> On 2025-Feb-03, Vladlen Popolitov wrote:
> 
>> You use FORMAT option to add new formats, filling it with routine name
>> in shared library. As result any caller can call any routine in 
>> PostgreSQL
>> kernel.
>> I think, it will start competition, who can find most dangerous 
>> routine
>> to call just from COPY FROM command.
> 
> Hah.
> 
> Maybe it would be a better UI to require that COPY format handlers are
> registered explicitly before they can be used:
> 
>  CREATE ACCESS METHOD copy_yaml TYPE copy HANDLER copy_yaml_handler;
> 
> ... and then when the FORMAT is not recognized as one of the hardcoded
> methods, we go look in pg_am for one with amtype='c' and the given 
> name.
> That gives you the function that initializes the Copy state.
> 
> This is convenient enough because system administrators can add COPY
> formats that anyone can use, and doesn't allow to call arbitrary
> functions via COPY.

Yes! It is what I propose. This looks much safer and already used in 
access methods creation.

-- 
Best regards,

Vladlen Popolitov.






view thread (14+ messages)

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: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
  Subject: Re: Make COPY format extendable: Extract COPY TO format implementations
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox