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

Reply via email to