dbTalk Databases Forums  

export-import problem

comp.databases.postgresql.general comp.databases.postgresql.general


Discuss export-import problem in the comp.databases.postgresql.general forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
GreyGeek
 
Posts: n/a

Default export-import problem - 10-28-2004 , 07:39 PM






I export data from a table that contains a varchar field that stores whole
names in it. Some of the names include the apostrophe character....
O'Neal, etc... When I attempt to import the data (using the copy command
the apostrophe kills the import. If I export the data with quotes around
the varchar field the quotes get stored inside the varchar field.
What the magic incantation to get apostrophes in textual data without
surrounding the data with quotes?
--
--
GreyGeek

Reply With Quote
  #2  
Old   
Oliver Elphick
 
Posts: n/a

Default Re: export-import problem - 11-01-2004 , 12:43 AM






On Thu, 2004-10-28 at 19:39 -0500, GreyGeek wrote:
Quote:
I export data from a table that contains a varchar field that stores whole
names in it. Some of the names include the apostrophe character....
O'Neal, etc... When I attempt to import the data (using the copy command
the apostrophe kills the import. If I export the data with quotes around
the varchar field the quotes get stored inside the varchar field.
What the magic incantation to get apostrophes in textual data without
surrounding the data with quotes?
Quotes have no special effect in COPY input:

junk=# create table jj (id INTEGER, jname text);
CREATE TABLE
junk=# copy jj from stdin;
Enter data to be copied followed by a newline.
End with a backslash and a period on a line by itself.
Quote:
1 O'Neil
2 O'Grady
\.
junk=#

What precisely are you doing?

--
Oliver Elphick olly (AT) lfix (DOT) co.uk
Isle of Wight http://www.lfix.co.uk/oliver
GPG: 1024D/A54310EA 92C8 39E7 280E 3631 3F0E 1EC0 5664 7A2F A543 10EA
========================================
"But they that wait upon the LORD shall renew their
strength; they shall mount up with wings as eagles;
they shall run, and not be weary; and they shall walk,
and not faint." Isaiah 40:31


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



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



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.