Re: COPY table_name (single_column) FROM 'iso-8859-1.txt' DELIMITER E'\n' - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: COPY table_name (single_column) FROM 'iso-8859-1.txt' DELIMITER E'\n'
Date
Msg-id fda2dc1b-cf93-c224-7cb2-e4eb02f317f7@dunslane.net
Whole thread Raw
In response to COPY table_name (single_column) FROM 'iso-8859-1.txt' DELIMITER E'\n'  ("Joel Jacobson" <joel@compiler.org>)
List pgsql-hackers
On 5/5/21 3:36 PM, Justin Pryzby wrote:
> On Wed, May 05, 2021 at 02:45:41PM -0400, Tom Lane wrote:
>>> I'm currently using the pg_read_file()-hack in a project,
>>> and even though it can read files up to 1GB,
>>> using e.g. regexp_split_to_table() to split on E'\n'
>>> seems to need 4x as much memory, so it only
>>> works with files less than ~256MB.
>> Yeah, that's because of the conversion to "chr".  But a regexp
>> is overkill for that anyway.  Don't we have something that will
>> split on simple substring matches?
> For v14
>
> commit 66f163068030b5c5fe792a0daee27822dac43791
> Author: Tom Lane <tgl@sss.pgh.pa.us>
> Date:   Wed Sep 2 18:23:56 2020 -0400
>
>     Add string_to_table() function.
>

Ha! just in time :-)


cheers


andrew


--
Andrew Dunstan
EDB: https://www.enterprisedb.com




pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Dubious assertion in RegisterDynamicBackgroundWorker
Next
From: Tom Lane
Date:
Subject: Re: COPY table_name (single_column) FROM 'iso-8859-1.txt' DELIMITER E'\n'