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

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: COPY table_name (single_column) FROM 'iso-8859-1.txt' DELIMITER E'\n'
Дата
Msg-id CAKFQuwYLOjHMvjREJUZ7dZ5EQGEOKnxJOYoPuKR6qqN09w9FcQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: COPY table_name (single_column) FROM 'iso-8859-1.txt' DELIMITER E'\n'  (Isaac Morland <isaac.morland@gmail.com>)
Ответы Re: COPY table_name (single_column) FROM 'iso-8859-1.txt' DELIMITER E'\n'  ("Joel Jacobson" <joel@compiler.org>)
Список pgsql-hackers
On Wed, May 5, 2021 at 10:34 AM Isaac Morland <isaac.morland@gmail.com> wrote:
On Wed, 5 May 2021 at 13:23, Chapman Flack <chap@anastigmatix.net> wrote:
On 05/05/21 13:02, David G. Johnston wrote:
> Why not just allow: "DELIMITER NONE" to be valid syntax meaning exactly
> what it says and does exactly what you desire?

What would it mean? That you get one column, multiple rows of text
corresponding to "lines" delimited by something, or that you get one
column, one row of text for the entire content of the file?

It means no column delimiter. In other words, there is no character which marks the end of a data value, so the entire line is a single data value.


This.  When dealing with COPY it's expected that each line becomes its own row.  On the server you can do pg_read_file() if you need the entire file to be considered a single value.  psql (\I and variables) is a bit more hackey, but I'd rather see that improved directly anyway if the goal is to try and make getting the "whole document" easier - copy isn't the right API for that IMO.

David J.

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Jeff Davis
Дата:
Сообщение: Re: MaxOffsetNumber for Table AMs
Следующее
От: Tom Lane
Дата:
Сообщение: v14 mechanical code beautification patches