agora inbox for pgsql-hackers@postgresql.org
help / color / mirror / Atom feedFrom: Sutou Kouhei <kou@clear-code.com>
To: sawada.mshk@gmail.com
Cc: michael@paquier.xyz
Cc: zhjwpku@gmail.com
Cc: andrew@dunslane.net
Cc: nathandbossart@gmail.com
Cc: pgsql-hackers@postgresql.org
Subject: Re: Make COPY format extendable: Extract COPY TO format implementations
Date: Fri, 15 Dec 2023 09:53:05 +0900 (JST)
Message-ID: <20231215.095305.1361997086905276509.kou@clear-code.com> (raw)
In-Reply-To: <CAD21AoCZv3cVU+NxR2s9J_dWvjrS350GFFr2vMgCH8wWxQ5hTQ@mail.gmail.com>
References: <CAD21AoCvjGserrtEU=UcA3Mfyfe6ftf9OXPHv9fiJ9DmXMJ2nQ@mail.gmail.com>
<20231214.184414.2179134502876898942.kou@clear-code.com>
<CAD21AoCZv3cVU+NxR2s9J_dWvjrS350GFFr2vMgCH8wWxQ5hTQ@mail.gmail.com>
Hi,
In <CAD21AoCZv3cVU+NxR2s9J_dWvjrS350GFFr2vMgCH8wWxQ5hTQ@mail.gmail.com>
"Re: Make COPY format extendable: Extract COPY TO format implementations" on Fri, 15 Dec 2023 05:19:43 +0900,
Masahiko Sawada <sawada.mshk@gmail.com> wrote:
> To avoid collisions, extensions can be created in a
> different schema than public.
Thanks. I didn't notice it.
> And note that built-in format copy handler doesn't need to
> declare its handler function.
Right. I know it.
> Adding a prefix or suffix would be one option but to give extensions
> more flexibility, another option would be to support format = 'custom'
> and add the "handler" option to specify a copy handler function name
> to call. For example, COPY ... FROM ... WITH (FORMAT = 'custom',
> HANDLER = 'arrow_copy_handler').
Interesting. If we use this option, users can choose an COPY
FORMAT implementation they like from multiple
implementations. For example, a developer may implement a
COPY FROM FORMAT = 'json' handler with PostgreSQL's JSON
related API and another developer may implement a handler
with simdjson[1] which is a fast JSON parser. Users can
choose whichever they like.
But specifying HANDLER = '...' explicitly is a bit
inconvenient. Because only one handler will be installed in
most use cases. In the case, users don't need to choose one
handler.
If we choose this option, it may be better that we also
provide a mechanism that can work without HANDLER. Searching
a function by name like tablesample method does is an option.
[1]: https://github.com/simdjson/simdjson
Thanks,
--
kou
view thread (340+ messages) latest in thread
Message-ID: <20231215.095305.1361997086905276509.kou@clear-code.com>
Permalink: ../20231215.095305.1361997086905276509.kou@clear-code.com/
Also on: postgresql.org/message-id/20231215.095305.1361997086905276509.kou@clear-code.com
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: kou@clear-code.com, sawada.mshk@gmail.com, michael@paquier.xyz, zhjwpku@gmail.com, andrew@dunslane.net, nathandbossart@gmail.com
Subject: Re: Make COPY format extendable: Extract COPY TO format implementations
In-Reply-To: <20231215.095305.1361997086905276509.kou@clear-code.com>
* 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