Re: pg_class catalog question...

From: "Jim C(dot) Nasby" <jnasby(at)pervasive(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Jonah H(dot) Harris" <jonah(dot)harris(at)gmail(dot)com>, Qingqing Zhou <zhouqq(at)cs(dot)toronto(dot)edu>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: pg_class catalog question...
Date: 2006-04-01 15:15:19
Message-ID: 20060401151519.GG49405@pervasive.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Mar 31, 2006 at 11:29:15AM -0500, Tom Lane wrote:
> "Jim C. Nasby" <jnasby(at)pervasive(dot)com> writes:
> > About the only reason I use CHAR in other databases systems is when I
> > know that the field will always contain the same amount of data, ie:
> > storing a SHA1. In these cases it's silly to have a 4 byte overhead to
> > store length. I really wish CHAR in PostgreSQL worked this way, so it
> > would be a welcome addition to have a type that did work this way. In
> > fact, I'd argue that CHAR should be made to work that way, and what's
> > currently called CHAR should be renamed for those who wish to use it.
>
> This argument falls flat when you consider that the width of a CHAR
> entry is measured in characters, not bytes, and therefore its physical
> size is not fixed even if its logical width is.

True, but in every case I've used char it was to store something that
would never be multi-byte, like a GUID, or a SHA1. Though I guess in
retrospect, what would really be handy is 'hex' datatype, that stores a
hex string (possibly with a custom format, such as a GUID) in it's
native binary format.
--
Jim C. Nasby, Sr. Engineering Consultant jnasby(at)pervasive(dot)com
Pervasive Software http://pervasive.com work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jim C. Nasby 2006-04-01 15:21:14 Re: Suggestion: Which Binary?
Previous Message Peter Eisentraut 2006-04-01 14:58:51 Re: Suggestion: Which Binary?