Re: New "single" COPY format

From: "Joel Jacobson" <joel(at)compiler(dot)org>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: "Masahiko Sawada" <sawada(dot)mshk(at)gmail(dot)com>, "PostgreSQL Hackers" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: New "single" COPY format
Date: 2024-11-08 07:42:43
Message-ID: 9a454fe9-78bd-4322-936a-b693548cb9f0@app.fastmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Nov 8, 2024, at 07:14, David G. Johnston wrote:
> On Thursday, November 7, 2024, Joel Jacobson <joel(at)compiler(dot)org> wrote:
>> On Fri, Nov 8, 2024, at 00:13, Masahiko Sawada wrote:
>> > In earlier versions, we supported loading the whole file into a single
>> > tuple. Is there any reason that it doesn't support it in v18? I think
>> > if it's useful we can improve it in a separate patch.
>>
>> Not sure how useful it is, since we already have pg_read_file().
>
> Being forced to have the file server-readable, non-stdin, destroys
> quite a bit of the usefulness of pg_read_file.
>
> If we want clients to be able to pass the effort here to the server,
> copy is definitely the most useful way to do so.

Right, good point, I agree.

> I’d be concerned choosing “single” given this future possibility. I do
> agree that such an enhancement would be best done in its own patch.

OK, sounds good to do it in its own patch.

If the name "single" doesn't work for this reason, I see at least
two alternatives:

1) Keep "single" as format name, and let it only be concerned about line by line
processing, and introduce a different format for entire file processing,
in its own patch.

2) Some other format name ("raw"?) that allows such future enhancement to
be done within the same format, in its own patch.

Other ideas?

/Joel

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Joel Jacobson 2024-11-08 08:04:30 Re: New "single" COPY format
Previous Message jian he 2024-11-08 06:44:40 Re: not null constraints, again