String lengths in the SQL backend

Derek Atkins warlord at MIT.EDU
Wed Nov 12 21:11:37 EST 2008


Quoting Eric Anopolsky <erpo41 at>:

> I'm not familiar with gnucash's data structures so I'm not 100% sure
> what a "code" is, but would it be possible to identify each account by
> an int or a bigint instead of a code? Then this secondary table could
> have the "account int" as its foreign primary key, and you could have
> another table that maps "account int" to "code" with the code as a
> varchar(2048) as desired.
> Or put the "account int" and the "code" in the same table and make the
> int the primary key instead.
> Totally unreasonable?

Uhh, yeah.  Sorry.  Totally unreasonable.

The "code" in question is a user-input field.  Historically accountants
used codes instead of names to keep track of accounts.  So GnuCash provides
a place for you to enter in an Account Code.  But it's a string, not a number.
Granted, most users probably do only use numbers, but there is no
requirement that it be a number.

> Cheers,
> Eric


       Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
       Member, MIT Student Information Processing Board  (SIPB)
       URL:    PP-ASEL-IA     N1NWH
       warlord at MIT.EDU                        PGP key available

More information about the gnucash-user mailing list