Re: New "single" COPY format

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Joel Jacobson <joel(at)compiler(dot)org>
Cc: Daniel Verite <daniel(at)manitou-mail(dot)org>, Aleksander Alekseev <aleksander(at)timescale(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: New "single" COPY format
Date: 2024-11-09 14:13:47
Message-ID: CAKFQuwYrwwgMzgAf45iubLbrFt-jTbMYLSrjzYo25+=5Fdaqfg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Saturday, November 9, 2024, Joel Jacobson <joel(at)compiler(dot)org> wrote:

> On Sat, Nov 9, 2024, at 08:07, Joel Jacobson wrote:
> > Here's a draft of an idea I'm considering (not yet implemented):
>
> I realize the last part about optional quoting is unnecessary,
> since if quoting is desired, users could just use the 'csv' format.
>
> Revised draft of the idea (not yet implemented):
>
> - Fast path for newline-free types:
> For the list of built-in types where we know the ::text representation
> cannot
> contain newlines, we take the fast path in NextCopyFromRawFields(),
> pointing cstate->raw_fields[0] directly to cstate->line_buf.data.
>
> - Handling newlines for other types:
> For any other types, we would need to scan the string for newline
> characters.
> If a newline is encountered, it results in an error.
>

Make sense to me.

David J.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David G. Johnston 2024-11-09 14:28:18 Re: New "single" COPY format
Previous Message wenhui qiu 2024-11-09 14:08:51 Re: New GUC autovacuum_max_threshold ?