Re: COPY FROM file with zero-delimited fields

Поиск
Список
Период
Сортировка
От eugene.mindrov@gmail.com
Тема Re: COPY FROM file with zero-delimited fields
Дата
Msg-id 1176453882.820209.178620@d57g2000hsg.googlegroups.com
обсуждение исходный текст
Ответ на Re: COPY FROM file with zero-delimited fields  ("Merlin Moncure" <mmoncure@gmail.com>)
Список pgsql-general
On Apr 11, 7:42 pm, mmonc...@gmail.com ("Merlin Moncure") wrote:
> On 11 Apr 2007 00:25:50 -0700, eugene.mind...@gmail.com
>
> <eugene.mind...@gmail.com> wrote:
> > Hi all,
> > I wonder if there's a way to use COPY FROM command when dealing with a
> > data file containing records whose fields are delimited with zero-
> > byte? Or I'd better change the delimiter? :)
>
> you can always run it through tr or similar tools first.
>
> merlin
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Have you searched our list archives?
>
>                http://archives.postgresql.org/

Yes, sure, I know that, but the matter is - the fields are mostly
textual ones, and can hold just about any text, so it's hard to choose
a right delimiter for fields, you know ;) I though I'd eliminate the
problem by using zero-byte for a field delimiter, but apparently COPY
FROM accepts only "printable" symbols as delimiters...
Another solution would be to escape potential delimiter everywhere in
the text fields, but that also requires using external tools... I had
a hope that COPY FROM can be persuaded to use some non-printable
character in its WITH DELIMITER clause, but apparently this is not the
case...


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

Предыдущее
От: "Terry Martin"
Дата:
Сообщение: question
Следующее
От: "Ben Trewern"
Дата:
Сообщение: Re: Providing user based previleges to Postgres DB