From: | <kaiq(at)realtyideas(dot)com> |
---|---|
To: | PostgreSQL-general <pgsql-general(at)postgreSQL(dot)org> |
Subject: | text field data transfer? |
Date: | 2000-02-16 02:06:13 |
Message-ID: | Pine.LNX.4.10.10002151940520.6138-100000@picasso.realtyideas.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
I need to transfer data from pg to m$sql.
m$sql has bcp (like pg's copy). bcp use delimiter.
there are 4 ways
1) use pg's copy then m$sql's bcp:
bcp does not recognize null. so, I have to use pg's copy
with null as '' (BTW, it does not work in 6.5.1, right?)
a more serious problem is that
text field usually contains ugly-dirty charactors,
so, what is the safe delimiter? -- the key here is that
delimiter approach does not escape
within the content (for speed).
2) to solve that headache, I try to use "pg_dump -D" .
however, pg put a lot of escape there (e.g.
\015 ).
also, int8 can not be used here. -- I rechecked the design,
and change it to int4 and then dump it :-)
more seriously, m$sql is strangely sensitive to the word "exit"
(quotation mark not included) within the sql single quotation
mark! m$shit!
3) dynamically connect two db. using perl.
or, if can not connected directly, use perl write a
"pg_dump-D-like" program.
4) bcp can use fix-length format. However, seems pg's copy can not.
of course, I can write a perl to do that. but text field can not
have fixed length!
Do I have to use 3) ? is there a short cut?
From | Date | Subject | |
---|---|---|---|
Next Message | Juan De Oliveira | 2000-02-16 02:20:30 | |
Previous Message | Hambleton, John | 2000-02-15 23:16:05 | Storing Queries |