Re: [GENERAL] \copy command: how to define a tab character as the delimiter

2010-03-09 Thread Adrian Klaver
On 03/09/2010 10:09 AM, Thomas Kellerer wrote: Raymond O'Donnell wrote on 09.03.2010 18:39: This is Postgres you're talking about - of course it's that easy! :-) :) The main reason I asked, was that the manual actually claims that '\t' can be used ("The following special backslash sequences a

Re: [GENERAL] \copy command: how to define a tab character as the delimiter

2010-03-09 Thread Tom Lane
Thomas Kellerer writes: > The main reason I asked, was that the manual actually claims that '\t' can be > used ("The following special backslash sequences are recognized by COPY FROM") \t is recognized in the copy data, not in the command's parameters. regards, tom lane

Re: [GENERAL] \copy command: how to define a tab character as the delimiter

2010-03-09 Thread Thomas Kellerer
Raymond O'Donnell wrote on 09.03.2010 18:39: This is Postgres you're talking about - of course it's that easy! :-) :) The main reason I asked, was that the manual actually claims that '\t' can be used ("The following special backslash sequences are recognized by COPY FROM") As this is part o

Re: [GENERAL] \copy command: how to define a tab character as the delimiter

2010-03-09 Thread Raymond O'Donnell
On 09/03/2010 17:30, Thomas Kellerer wrote: > Tom Lane wrote on 09.03.2010 18:21: >> Thomas Kellerer writes: >>> \copy foo (foo, bar) from foobar.txt delimiter as '\t' csv header >> >>> So how can I specify a tab character if I also need to specify that >>> my file has a header line? >> >> Type an

Re: [GENERAL] \copy command: how to define a tab character as the delimiter

2010-03-09 Thread Thomas Kellerer
Tom Lane wrote on 09.03.2010 18:21: Thomas Kellerer writes: \copy foo (foo, bar) from foobar.txt delimiter as '\t' csv header So how can I specify a tab character if I also need to specify that my file has a header line? Type an actual tab. Blush That easy? Thanks Thomas -- Se

Re: [GENERAL] \copy command: how to define a tab character as the delimiter

2010-03-09 Thread Tom Lane
Thomas Kellerer writes: > \copy foo (foo, bar) from foobar.txt delimiter as '\t' csv header > So how can I specify a tab character if I also need to specify that my file > has a header line? Type an actual tab. regards, tom lane -- Sent via pgsql-general mailing list

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

2010-03-09 Thread Thomas Kellerer
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