Re: New "raw" COPY format - Mailing list pgsql-hackers

From Joel Jacobson
Subject Re: New "raw" COPY format
Date
Msg-id 12aac0fe-5d5c-43ea-b530-e9fbe8160651@app.fastmail.com
Whole thread Raw
In response to Re: New "raw" COPY format  ("Joel Jacobson" <joel@compiler.org>)
Responses Re: New "raw" COPY format
List pgsql-hackers
On Wed, Oct 16, 2024, at 20:30, Joel Jacobson wrote:
> A final thought is to maybe consider just skipping
> the automagical newline detection for RAW?
>
> Instead of the automagical detection,
> the default newline delimiter could be the OS default,
> similar to how COPY TO works.
>
> That way, it would almost always just work for most users,
> as long as processing files within their OS,
> and when not, they would just need to specify the DELIMITER.

I would guess that nowadays, dealing with unstructured text files
are probably less common, than dealing with structured text files,
such as JSON, YAML, TOML, XML, etc.

Therefore, maybe DELIMITER NONE would be a better default
for RAW? Especially since it's then also more honest in being "raw".

If needing to import an unstructured text file that is just newline
delimited, and not wanting the entire file as a single value,
the newline style would then just need to be specified
using the DELIMITER option.

/Joel



pgsql-hackers by date:

Previous
From: Peter Geoghegan
Date:
Subject: Re: Limiting overshoot in nbtree's parallel SAOP index scans
Next
From: Masahiko Sawada
Date:
Subject: Re: Using per-transaction memory contexts for storing decoded tuples