Re: Back Slash \ issue

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: Back Slash \ issue
Дата
Msg-id 20190503140444.yfov3km235ddhdgv@momjian.us
обсуждение исходный текст
Ответ на Re: Back Slash \ issue  (Adrian Klaver <adrian.klaver@aklaver.com>)
Ответы Re: Back Slash \ issue  (Bruce Momjian <bruce@momjian.us>)
Список pgsql-general
On Fri, May  3, 2019 at 06:55:55AM -0700, Adrian Klaver wrote:
> On 5/2/19 10:48 PM, Guntry Vinod wrote:
> 
> Please do not top post. Inline/bottom posting is the preferred style on this
> list.
> > Hi Team,
> > 
> > We are using the below command
> > 
> > COPY <<TableName>> from 'C:\Data_Dump\ABC.txt' DELIMITER '|';
> 
> The above shows what you are doing on the input into Postgres.
> We still do not know how you are dumping the data from DB2.
> 
> In what format are you dumping the DB2 data and with what specifications
> e.g. quoting?

On thing the original poster might be missing is that the copy DELIMITER
is used between fields, while backslash is used as an escape before a
single character.  While it might be tempting to try to redefine the
escape character with the copy ESCAPE keyword, that keyword only works
in CSV mode.

The Postgres COPY format is very reliable and able to dump/reload _any_
data sequence.  Many commercial data dump implementations are simpler
but are not able to be as reliable.

The bottom line is that you are going to need to double the backslashes
unless you move to CSV mode.

-- 
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

+ As you are, so once was I.  As I am, so you will be. +
+                      Ancient Roman grave inscription +



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

Предыдущее
От: Jeff Janes
Дата:
Сообщение: Re: Starting Postgres when there is no disk space
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: Back Slash \ issue