From: | Martijn van Oosterhout <kleptog(at)svana(dot)org> |
---|---|
To: | Jim Nasby <jnasby(at)pervasive(dot)com> |
Cc: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Jonah H(dot) Harris" <jonah(dot)harris(at)gmail(dot)com>, Thomas Hallgren <thomas(at)tada(dot)se>, Qingqing Zhou <zhouqq(at)cs(dot)toronto(dot)edu>, pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: pg_class catalog question... |
Date: | 2006-04-04 05:20:54 |
Message-ID: | 20060404052054.GA32226@svana.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Mon, Apr 03, 2006 at 01:31:50PM -0400, Jim Nasby wrote:
> I'm not sure how other databases handle this, but I suspect it would
> be OK performance-wise to tack on a length byte for these types when
> dealing with functions and anything else that isn't directly tied to
> a table where you can easily get length info from the catalog.
>
> Actually, how is this handled with varchar(x)?
By storing the length in the Datum.
This discussion as about whether we could support something like HEX(n)
without storing the (n) in the data field but only in the catalog.
varchar(n) doesn't have this issue because we always store the length,
so everywhere that needs to know already does.
If your not worried about the length field you could code this up in an
afternoon. In fact, it's probably already been done...
--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.
From | Date | Subject | |
---|---|---|---|
Next Message | siva kumar | 2006-04-04 07:26:30 | will it work |
Previous Message | Rick Craft | 2006-04-04 04:26:33 | BUG #2374: Installation Error |