Re: Tabbed data in tab-separated output

Поиск
Список
Период
Сортировка
От mike
Тема Re: Tabbed data in tab-separated output
Дата
Msg-id 1167885106.18404.7.camel@localhost.localdomain
обсуждение исходный текст
Ответ на Tabbed data in tab-separated output  (felix@crowfix.com)
Ответы Re: Tabbed data in tab-separated output  (felix@crowfix.com)
Список pgsql-general
How are you attempting to restore the table after using psql?  Psql
insert statements? Pgdump? COPY FROM?

Mike
On Wed, 2007-01-03 at 17:59 -0800, felix@crowfix.com wrote:
> I have a table which has a few VARCHAR columns whose first character
> is a tab.  If I run pg_dump on this table, it outputs data like this:
>
>     43158  \t555-1212    3
>
> where the two embedded white spaces are actually tabs.
>
> If I use psql to execute SQL to dump parts of the table, like this:
>
>     psql -qtA -f '\t' -U xyzzy xyzzy -c 'select ... >/tmp/xxx
>
> I get this:
>
>     43158        310-319-1333, x1070    3
>
> where that initial embeded white space represents two tabs.  When I
> use psql to restore this data, it thinks the 2nd column is empty and
> complains that the third column is the wrong type.
>
> pg_dump apparently is smart enough to print embedded tabs as escaped
> chars, but not psql.  Is there a fix for this?  I thought of reverting
> to standard output, without the -t option, and analyzing the first two
> lines to tell exactly how many spaces are assigned to each column, but
> that gives me the shudders.
>


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

Предыдущее
От: mike
Дата:
Сообщение: Re: could not open file xxxx for writing: Permission
Следующее
От: "Magnus Hagander"
Дата:
Сообщение: Re: could not open file xxxx for writing: Permission denied