Re: New "raw" COPY format

From: "Joel Jacobson" <joel(at)compiler(dot)org>
To: "jian he" <jian(dot)universality(at)gmail(dot)com>
Cc: "Tatsuo Ishii" <ishii(at)postgresql(dot)org>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: New "raw" COPY format
Date: 2024-10-16 06:37:24
Message-ID: c027bc38-bfa3-4fe9-a58e-018d88879538@app.fastmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Oct 16, 2024, at 05:31, jian he wrote:
> Hi.
> I only checked 0001, 0002, 0003.
> the raw format patch is v9-0016.
> 003-0016 is a lot of small patches, maybe you can consolidate it to
> make the review more easier.

Thanks for reviewing.

OK, I've consolidated the v9 0003-0016 into a single patch.

(I submitted them as separate smaller patches since it might be difficult
otherwise to verify the correctness of the refactoring of ProcessCopyOptions().
So if needed, the smaller patches can be viewed in the previous email.
I've only squashed them in the attached patch set, except the setting
of COPY_FORMAT_TEXT = 0, see below.)

> -COPY x to stdin (format TEXT, force_quote(a));
> +COPY x to stdout (format TEXT, force_quote(a));
> 0001 make sense to me, i think generally we do "to stdout", "from stdin"
>
> v9-0002-Fix-validation-of-FORCE_NOT_NULL-FORCE_NULL-for-all-.patch
> looks good.

OK, cool.

> typedef enum CopyFormat
> {
> COPY_FORMAT_TEXT,
> COPY_FORMAT_BINARY,
> COPY_FORMAT_CSV,
> } CopyFormat;
>
...
> I think you may need COPY_FORMAT_TEXT = 0, even though based on [1],
> it seems not required.

OK, changed, and I agree, since this seems to be the style in copy.h,
even if not setting = 0 seems to be more popular in the codebase in general.

/Joel

Attachment Content-Type Size
v10-0001-Fix-thinko-in-tests-for-COPY-options-force_not_null-.patch application/octet-stream 4.6 KB
v10-0002-Fix-validation-of-FORCE_NOT_NULL-FORCE_NULL-for-all-.patch application/octet-stream 5.0 KB
v10-0003-Add-raw-COPY-format-support-for-unstructured-text-da.patch application/octet-stream 68.6 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2024-10-16 06:54:54 Re: Enable data checksums by default
Previous Message Daniel Gustafsson 2024-10-16 06:31:09 Re: Remove deprecated -H option from oid2name