Re: pg_class catalog question...

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: pg_class catalog question...
Дата
Msg-id 20060404052054.GA32226@svana.org
обсуждение исходный текст
Ответ на Re: pg_class catalog question...  (Jim Nasby <jnasby@pervasive.com>)
Список 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@svana.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.

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Fixing domain input
Следующее
От: Andrew Dunstan
Дата:
Сообщение: Re: Suggestion: Which Binary?