Which hook to use when overriding utility commands (COPY ...)

From: Hannu Krosing <hannuk(at)google(dot)com>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Which hook to use when overriding utility commands (COPY ...)
Date: 2022-03-19 11:28:46
Message-ID: CAMT0RQRPRu9CwKnXM5dA7F5L-UsGkS_pNyH23hyO1xJZE95OKg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Pgsql-Hackers

Which hook should I use when overriding the COPY command in an extension?

I am working on adding new functionalities to COPY (compression, index
management, various other transports in addition to stdin and file, other
data formats, etc...) and while the aim is to contribute this to v15 I
would also like to have much of it in earlier versions.

As the current policy is to back-port only bugfixes and not "features" ,
the only way I can see to get it in earlier versions is to provide an
extension which intercepts the COPY command and replaces it with my own
implementation.

So my question is, which of the hooks would be easiest to use for this ?

At the syntax level it would still look the same COPY ... FROM/TO ... WITH
( options) and the extensibility will be in file names (using a URI scheme
mapped to transports) and in options part.
so I hope to fully reuse the parsing part and get in before the existence
checks.

Does anyone have experience in this and can [point to samples?

Cheers
Hannu

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2022-03-19 12:44:18 Re: Which hook to use when overriding utility commands (COPY ...)
Previous Message Alvaro Herrera 2022-03-19 10:48:35 Re: support for MERGE