\copy command: how to define a tab character as the delimiter

From: Thomas Kellerer <spam_eater(at)gmx(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: \copy command: how to define a tab character as the delimiter
Date: 2010-03-08 23:00:53
Message-ID: hn3vj5$th4$1@dough.gmane.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Sam Carleton 2010-03-08 23:48:05 Re: managing tablespaces like files?
Previous Message John R Pierce 2010-03-08 22:46:15 Re: managing tablespaces like files?