Unix Technical Forum

No quoting in copy CSV mode

This is a discussion on No quoting in copy CSV mode within the pgsql Novice forums, part of the PostgreSQL category; --> I have a file that is tab-delimited text that I am trying to load via psql \copy (postgresql 8.1). ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Novice

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-17-2008, 10:51 PM
Sean Davis
 
Posts: n/a
Default No quoting in copy CSV mode

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


---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-17-2008, 10:51 PM
Bruce Momjian
 
Posts: n/a
Default Re: No quoting in copy CSV mode

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. +

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 02:45 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com