\copy command: how to define a tab character as the delimiter - Mailing list pgsql-general

From Thomas Kellerer
Subject \copy command: how to define a tab character as the delimiter
Date
Msg-id hn3vj5$th4$1@dough.gmane.org
Whole thread Raw
Responses Re: \copy command: how to define a tab character as the delimiter
List pgsql-general
Hi,

I tried to import a text file using the \copy command in psql using the following:

\copy foo (foo, bar) from foobar.txt delimiter as '\t' csv header

but that gives me an error:

ERROR:  COPY delimiter must be a single one-byte character

So how can I specify a tab character if I also need to specify that my file has a header line?

Regards
Thomas

pgsql-general by date:

Previous
From: Greg Smith
Date:
Subject: Re: kernel version impact on PostgreSQL performance
Next
From: Harald Fuchs
Date:
Subject: Re: DROP column: documentation unclear