Re: COPY FROM file with zero-delimited fields - Mailing list pgsql-general

From eugene.mindrov@gmail.com
Subject Re: COPY FROM file with zero-delimited fields
Date
Msg-id 1176453882.820209.178620@d57g2000hsg.googlegroups.com
Whole thread Raw
In response to Re: COPY FROM file with zero-delimited fields  ("Merlin Moncure" <mmoncure@gmail.com>)
List 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 by date:

Previous
From: "Terry Martin"
Date:
Subject: question
Next
From: "Ben Trewern"
Date:
Subject: Re: Providing user based previleges to Postgres DB