Re: Enum proposal / design

From: "Tom Dunstan" <pgsql(at)tomd(dot)cc>
To: Gregory Stark <gsstark(at)mit(dot)edu>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Enum proposal / design
Date: 2006-08-17 02:47:22
Message-ID: 44e3d8ba.2b6.6638.18952@internode.on.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:
>
> > I think this is excessive concern for bit-shaving.
>
> Egads. bit-shaving is *important*. If it's 8 bytes you
> could just use a char(4) and store 4 character text codes
> instead. The whole reason to want this feature is
> precisely for bit-shaving.

Well, and that there's no straight substitute for the actual
feature. The closest you'll get is a domain, but they don't
order stuff properly. Efficiency is clearly a driving factor
as well, though, hence my reluctance to store 8 bytes on
disk. :)

> ...

> This is the same issue we have with char(n) and numeric(x
> ,y) already. If we found a general solution for getting
> the type name to the enum would it also help getting the
> typmod to char(n) and numeric(x,y)? Would it let us store
> those as fixed sized data types?

It also affects composite types. And some user types out
there like Martijn's tagged types.

I didn't really want to go down that path in this thread
since it would turn what should be a fairly non-intrusive
patch to add a new type into a big thing, and I really just
wanted to get enums in. :) I tend to think of it the other
way around from how you put it: if a general solution to
that problem can be found which does fall afoul of the
security issues that were the reason for multi-argument
output functions to be killed off in the first place, then
great, and enums can directly benefit.

Cheers

Tom

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message ITAGAKI Takahiro 2006-08-17 03:55:28 Re: pgstattuple extension for indexes
Previous Message Alvaro Herrera 2006-08-17 02:33:50 Re: Adjust autovacuum naptime automatically