[Bioperl-l] postgres datatype: VARCHAR to TEXT - patch

Erikjan er at xs4all.nl
Mon Oct 22 12:05:29 EDT 2007


Using load_seqdatabase.pl to load uniprot_sprot.dat into
postgres (8.2.5), biosql gave me:

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

(all fresh from cvs)

Changing 'VARCHAR(N)' to 'TEXT' fixed those errors.

Generally, VARCHAR[(N)], (=character varying) are probably
better replaced with 'TEXT' as VARCHAR(N) is implemented
as TEXT with a check on length.

Attached is a patch for the table definitions in
biosqldb-pg.sql; I haven't changed the other scripts, as I
don't know if you will agree with this improvement.

(The other table-creating scripts are probably also better
off with a change from VARCHAR (=character varying) to the
text datatype.)

(loading uniprot_sprot.dat took 20 hours to load, but now
without errors, so I won't complain :)



-------------- next part --------------
A non-text attachment was scrubbed...
Name: biosqldb-pg.sql.diff
Type: application/octet-stream
Size: 3973 bytes
Desc: not available
Url : http://lists.open-bio.org/pipermail/bioperl-l/attachments/20071022/b2d3c783/attachment.obj 

More information about the Bioperl-l mailing list