Обсуждение: No quoting in copy CSV mode

Поиск
Список
Период
Сортировка

No quoting in copy CSV mode

От
Sean Davis
Дата:
I have a file that is tab-delimited text that I am trying to load via psql
\copy (postgresql 8.1).  It contains quotes (and every other character I
have tried) as well as escapes.  I therefore would like to use the escape
parameter to COPY, but have no quoting characters be recognized.  However,
it seems that there is no way to turn off quoting in CSV mode.  Any
workarounds that folks see?

Thanks,
Sean


Re: No quoting in copy CSV mode

От
Bruce Momjian
Дата:
Sean Davis wrote:
> I have a file that is tab-delimited text that I am trying to load via psql
> \copy (postgresql 8.1).  It contains quotes (and every other character I
> have tried) as well as escapes.  I therefore would like to use the escape
> parameter to COPY, but have no quoting characters be recognized.  However,
> it seems that there is no way to turn off quoting in CSV mode.  Any
> workarounds that folks see?

You use two double-quotes to represent a single double quote in the
data.

--
  Bruce Momjian   http://candle.pha.pa.us
  EnterpriseDB    http://www.enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +