Re: Good Delimiter for copy command

Поиск
Список
Период
Сортировка
От Mark Roberts
Тема Re: Good Delimiter for copy command
Дата
Msg-id 1234477141.11148.252.camel@localhost
обсуждение исходный текст
Ответ на Re: Good Delimiter for copy command  (SHARMILA JOTHIRAJAH <sharmi_jo@yahoo.com>)
Список pgsql-general
On Thu, 2009-02-12 at 12:51 -0800, SHARMILA JOTHIRAJAH wrote:
>
> My data fields contains commas, tabs,'|'  etc. So I cant use t hem as
> delimiters..so I need a unique may be non-character to use as a
> delimiter...
> -Sharmila

Is this a theoretical problem or an actual one?  I haven't had any
problems with the default (tab).  In fact, copying from one database to
another is an exceedingly common task that I do, all done with tab.

dev=> create table foo (a text);
CREATE TABLE
Time: 385.967 ms
dev=> insert into foo values ('     '); -- literal tab
INSERT 0 1
Time: 0.536 ms
dev=> insert into foo values ('\t'); -- special character, parsed.
INSERT 0 1
Time: 0.224 ms
dev=> insert into foo values ('\\t'); -- backslash, t
INSERT 0 1
Time: 0.183 ms
dev=> copy foo to stdout;
\t
\t
\\t
Time: 0.188 ms
dev=> select * from foo;
  a
------
 \x09
 \x09
 \t
(3 rows)

Time: 0.239 ms
dev=>


-Mark


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Good Delimiter for copy command
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: R: R: How to check if 2 series of data are equal