Bug: G1 -> G2 fails w/Postgres 8 & long captions

Jay Levitt

Joined: 2006-03-20
Posts: 3
Posted: Mon, 2006-03-20 18:11

When migrating a G1 gallery, the length checking and truncation doesn't happen until Postgres has already return an error. I had an album that had some particularly long captions, which I'm migrating into the G2 summary field. However, summary is a char var(255) on Postgres, and when the migration script tries to write into it, it'll get:

ERROR: value too long for type character varying(255)

from Postgres. Worse, even though transactions are being used, this error seems to leave the album in an undefined state; I can't perform any further imports (they just show the progress bar and then the page is done, even with debugging on), although I can upload images myself.

Workaround: I'm changing the summary field in g2_item from char var(255) to text, since there are no performance disadvantages to the text type in PGSQL, and no particular advantages to char-var. Now I'm properly getting the "too long: truncated" messages on migration.


G2 version: 2.1RC2a
G1 version: 1.5.2-pl2
--
PHP version (e.g. 4.3.11): 5.1.2
Webserver (e.g. Apache 1.3.33): Apache 2.0.54
Database (e.g. MySql 4.0.11): PostgresQL 8.0.3
Activated toolkits (e.g. NetPbm, GD): all three
Operating system (e.g. Linux): Mandrake 10.1
Browser (e.g. Firefox 1.0): Firefox 1.5

 
ckdake
ckdake's picture

Joined: 2004-02-18
Posts: 2258
Posted: Sun, 2006-04-02 16:49

Please reproduce this with the latest nightly, and if you can file a but at http://sf.net/projects/gallery. Thanks!

--
http://ckdake.com/

If you found my help useful, please consider donating to Gallery.