[Open-bio-l] char(n) vs. varchar(n) in BioSQL
Chris Mungall
cjm@fruitfly.bdgp.berkeley.edu
Fri, 8 Mar 2002 13:06:40 -0800 (PST)
On Fri, 8 Mar 2002, Thomas Down wrote:
> Hi...
>
> During the last round of schema-changes, some columns
> were changed from varchar(n) to char(n) data types. When
> I questioned this, I was told that it's still possible to
> store variable-length strings in char(n) columns. This
> doesn't turn out to be entirely true. MySQL includes some
> special-case code to strip trailing spaces when retrieving
> char(n) attributes, which gives the illusion of supporting
> variable length strings. Other databases don't even do
> this.
Actually, it's not MySQL special case code, it's perl - specifically the
ChopBlanks option in DBI
> Anyway, just to give other implementors a heads-up: strings
> from the ontology_term.term_name and seqfeature_source.source_name
> columns will need to be trimmed client-side, if you want to
> maintain database portability. I still think these should
> probably have stayed varchar(n). On the other hand, it's
> not a big enough issue to warrant another schema change.
I'm willing to go with the vote. I thought that fixed with records were
faster in most DBMSs but I could be imagining that. If this isn't true we
should switch back to varchar.
> Thomas.
> _______________________________________________
> Open-Bio-l mailing list
> Open-Bio-l@open-bio.org
> http://open-bio.org/mailman/listinfo/open-bio-l
>