[rt-users] MySQL -> Postres sql insertion errors

Stan rt at vtwireless.com
Fri Jan 14 15:16:36 EST 2005


I am attempting to migrate my data from MySQL to Postgres to see if that 
speeds up my RT installation.  So far I have created the Postgres 
schema, and exported the data from Mysql.
When I attempt to import the data into Postgres, I get lots of nasty 
messages 
psql:Migrationfile.sql:338: ERROR:  duplicate key violates unique 
constraint "attachments_pkey"
psql:Migrationfile.sql:339: ERROR:  duplicate key violates unique 
constraint "attachments_pkey"
psql:Migrationfile.sql:340: ERROR:  duplicate key violates unique 
constraint "attachments_pkey"
psql:Migrationfile.sql:341: ERROR:  duplicate key violates unique 
constraint "attachments_pkey"
psql:Migrationfile.sql:342: ERROR:  duplicate key violates unique 
constraint "attachments_pkey"
psql:Migrationfile.sql:343: ERROR:  duplicate key violates unique 
constraint "attachments_pkey"
psql:Migrationfile.sql:344: ERROR:  duplicate key violates unique 
constraint "attachments_pkey"
psql:Migrationfile.sql:345: ERROR:  duplicate key violates unique 
constraint "attachments_pkey"
psql:Migrationfile.sql:346: ERROR:  duplicate key violates unique 
constraint "attachments_pkey"
psql:Migrationfile.sql:347: invalid command \0Ì~H9òâ~YøRq
psql:Migrationfile.sql:347: \r: extra argument "278" ignored
psql:Migrationfile.sql:347: \r: extra argument "333" ignored
psql:Migrationfile.sql:347: \r: extra argument "474" ignored
psql:Migrationfile.sql:347: \r: extra argument "556" ignored
psql:Migrationfile.sql:347: \r: extra argument "556" ignored
psql:Migrationfile.sql:347: \r: extra argument "889" ignored
psql:Migrationfile.sql:347: \r: extra argument "722" ignored
psql:Migrationfile.sql:347: \r: extra argument "238" ignored
psql:Migrationfile.sql:347: \r: extra argument "333" ignored
psql:Migrationfile.sql:347: \r: extra argument "333" ignored
psql:Migrationfile.sql:347: \r: extra argument "389" ignored

The insert on line 347 looks like this:

INSERT INTO Attachments (id, TransactionId, Parent, MessageId, Subject, 
Filename, ContentType, ContentEncoding, Content, Headers, Cr
eator, Created) VALUES 
(152,248,148,NULL,'','Estimate_17_from_X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3ôµXæë·bÚ^Y®:Y~S^Q÷x\\Âê^LÅ| 
Wµ¤^XA%\ZÆò^Lé^O³§ù)~^~Vpß^]û^A>~I~Z^Y¿u06~[{Ñ¢vu»àLÉáÝp»~[ç^?¢~I 
)+ä\0}\n-®8O§è~R.~B~KéJ
¼³8¶Ã~Uׯ^^±^[ÎD?»¸·~F^F~SÊ~ö^NyÄKs~Q;\\~T?FÈ|^BsâyDxéxò?r1~Tøendstream\rendobj\r6 
0 obj\r1473\rendobj\r7 0 obj\r<<\r/Type /Page\r/P
arent 3 0 R\r/MediaBox [0 0 612 792]\r/Rotate 0\r/Contents [5 0 
R]\r/Resources <<\r/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]\r/C
olorSpace << /CS1 [/Pattern /DeviceGray] /CS2 [/Pattern /DeviceRGB] 
 >>\r/Font << /F8 8 0 R /F9 9 0 R /F10 10 0 R >>\r>>\r>>\rendobj\
r8 0 obj\r<<\r/Type /Font\r/Subtype /TrueType\r/Name /F8\r/BaseFont 
/Arial,Bold\r/Encoding /WinAnsiEncoding\r/FirstChar 32\r/LastCha
r 255\r/Widths [ \r278 333 474 556 556 889 722 238 333 333 389 584 278 
333 278 278 556 556 556 556 556 556 556 556 556 556 333 333 5
84 584 584 611 975 722 722 722 722 667 611 778 722 278 556 722 611 833 
722 778 667 778 722 667 611 722 667 944 667 667 611 333 278 3
33 584 556 \r333 556 611 556 611 556 333 611 611 278 278 556 278 889 611 
611 611 611 389 556 333 611 556 778 556 556 500 389 280 389
584 420 556 420 278 556 500 1000 556 556 333 1000 667 333 1000 420 611 
420 420 278 278 500 500 350 556 1000 333 1000 556 333 944 42
0 500 667 \r278 333 556 556 556 556 280 556 333 737 370 556 584 333 737 
552 400 549 333 333 333 576 556 278 333 333 365 556 834 834
834 611 722 722 722 722 722 722 1000 722 667 667 667 667 278 278 278 278 
722 722 778 778 778 778 778 584 778 722 722 722 722 667 667
611 \r556 556 556 556 556 556 889 556 556 556 556 556 278 278 278 278 
611 611 611 611 611 611 611 549 611 611 611 611 611 556 611 5
56 ]\r/FontDescriptor 11 0 R\r>>\rendobj\r11 0 obj\r<<\r/Type 
/FontDescriptor\r/FontName /Arial,Bold\r/Flags 32\r/FontBBox [ -628 -3
76 2034 1010 ]\r/MissingWidth 760\r/StemV 80\r/StemH 80\r/ItalicAngle 
0\r/CapHeight 820\r/XHeight 574\r/Ascent 820\r/Descent 220\r/L
eading 40\r/MaxWidth 1020\r/AvgWidth 420\r>>\rendobj\r9 0 obj\r<<\r/Type 
/Font\r/Subtype /TrueType\r/Name /F9\r/BaseFont /Arial\r/En
coding /WinAnsiEncoding\r/FirstChar 32\r/LastChar 255\r/Widths [ \r278 
278 355 556 556 889 667 191 333 333 389 584 278 333 278 278 5
56 556 556 556 556 556 556 556 556 556 278 278 584 584 584 556 1015 667 
667 722 722 667 611 778 722 278 500 667 556 833 722 778 667
778 722 667 611 722 667 944 667 667 611 278 278 278 469 556 \r333 556 
556 500 556 556 278 556 556 222 222 500 222 833 556 556 556 55
6 333 500 278 556 500 722 500 500 500 334 260 334 584 420 556 420 222 
556 333 1000 556 556 333 1000 667 333 1000 420 611 420 420 222
222 333 333 350 556 1000 333 1000 500 333 944 420 500 667 \r278 333 556 
556 556 556 260 556 333 737 370 556 584 333 737 552 400 549
333 333 333 576 537 278 333 333 365 556 834 834 834 611 667 667 667 667 
667 667 1000 722 667 667 667 667 278 278 278 278 722 722 77
8 778 778 778 778 584 778 722 722 722 722 667 667 611 \r556 556 556 556 
556 556 889 500 556 556 556 556 278 278 278 278 556 556 556
556 556 556 556 549 611 556 556 556 556 500 556 500 ]\r/FontDescriptor 
12 0 R\r>>\rendobj\r12 0 obj\r<<\r/Type /FontDescriptor\r/Fon
tName /Arial\r/Flags 32\r/FontBBox [ -665 -325 2028 1006 
]\r/MissingWidth 760\r/StemV 80\r/StemH 80\r/ItalicAngle 0\r/CapHeight 820\
r/XHeight 574\r/Ascent 820\r/Descent 220\r/Leading 40\r/MaxWidth 
1020\r/AvgWidth 420\r>>\rendobj\r10 0 obj\r<<\r/Type /Font\r/Subtyp
e /TrueType\r/Name /F10\r/BaseFont /TimesNewRoman\r/Encoding 
/WinAnsiEncoding\r/FirstChar 32\r/LastChar 255\r/Widths [ \r250 333 408
500 500 833 778 180 333 333 500 564 250 333 250 278 500 500 500 500 500 
500 500 500 500 500 278 278 564 564 564 444 921 722 667 667
722 611 556 722 722 333 389 722 611 889 722 722 556 722 667 556 611 722 
722 944 722 722 611 333 278 333 469 500 \r333 444 500 444 5
00 444 333 500 500 278 278 500 278 778 500 500 500 500 333 389 278 500 
500 722 500 500 444 480 200 480 541 420 500 420 333 500 444 1
000 500 500 333 1000 556 333 889 420 611 420 420 333 333 444 444 350 500 
1000 333 980 389 333 722 420 444 722 \r250 333 500 500 500
500 200 500 333 760 276 500 564 333 760 500 400 549 300 300 333 576 453 
250 333 300 310 500 750 750 750 444 722 722 722 722 722 722
889 667 611 611 611 611 333 333 333 333 722 722 722 722 722 722 722 564 
722 722 722 722 722 722 556 500 \r444 444 444 444 444 444 66
7 444 444 444 444 444 278 278 278 278 500 500 500 500 500 500 500 549 
500 500 500 500 500 500 500 500 ]\r/FontDescriptor 13 0 R\r>>\
rendobj\r13 0 obj\r<<\r/Type /FontDescriptor\r/FontName 
/TimesNewRoman\r/Flags 32\r/FontBBox [ -568 -307 2028 1007 ]\r/MissingWidth
760\r/StemV 80\r/StemH 80\r/ItalicAngle 0\r/CapHeight 820\r/XHeight 
574\r/Ascent 820\r/Descent 220\r/Leading 40\r/MaxWidth 1020\r/Av
gWidth 420\r>>\rendobj\r3 0 obj\r<<\r/Type /Pages\r/Count 1\r/Kids [7 0 
R]\r/Resources <<\r/ProcSet [/PDF /Text /ImageB /ImageC /Ima
geI]\r/ColorSpace << /CS1 [/Pattern /DeviceGray] /CS2 [/Pattern 
/DeviceRGB] >>\r/Font << /F8 8 0 R /F9 9 0 R /F10 10 0 R  >>\r\r>>\r
 >>\rendobj\r2 0 obj\r<<\r/Type /Catalog\r/Pages 3 0 R\r>>\rendobj\r1 0 
obj\r<<\r/Title (Intuit_QBOB_Internal.pdf)\r/Producer (Amyuni
PDF Converter)\r/Version (Version 2.07c Pro - Intuit 
Inc.)\r/CreationDate (19/6/2004 15:35:1)\r>>\rendobj\rxref\r0 
14\r0000000000 6
5535 f \r0000006157 00000 n \r0000006108 00000 n \r0000005869 00000 n 
\r0000000000 00000 n \r0000000017 00000 n \r0000001563 00000 n
\r0000001583 00000 n \r0000001862 00000 n \r0000003199 00000 n 
\r0000004527 00000 n \r0000002942 00000 n \r0000004275 00000 n \r000
0005609 00000 n \rtrailer\r<<\r/Size 14\r/Root 2 0 R\r/Info 1 0 
R\r>>\rstartxref\r6322\r%%EOF\r','content-type: application/pdf; nam
e=\"Estimate_17_from_XXXXXXXXXXX.pdf\"\ncontent-disposition: attachment; 
filename=\"Estimate_17_from_XXXXXXXXX.pdf
\"\nContent-Transfer-Encoding: base64\nContent-Length: 
6680\n',374,'2004-06-19 19:36:55');

What do I need to do to make this data Postgres-insert friendly?

Thanks



More information about the rt-users mailing list