Re: enum types and binary queries

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Gregory Stark <stark(at)enterprisedb(dot)com>
Cc: Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Merlin Moncure <mmoncure(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: enum types and binary queries
Date: 2007-08-31 15:14:29
Message-ID: 46D83055.3000109@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Gregory Stark wrote:
> enum OIDs are unique across enums? This seems like a strange way to do it. I
> recall conversations about this a while back though and there were limitations
> of the type system that led to this, right?
>

No, not the type system as such. It stems from this quote from Tom:

> If an output function depends on anything more than the contents of
> the object it's handed, it's vulnerable to being lied to.
> http://archives.postgresql.org/pgsql-hackers/2005-04/msg00998.php

So the value passed to the enum_out function has to be sufficiently
unique to be able to look up the label. This arrangement got the best
combination of compactness and simplicity that we could come up with at
the time.

Incidentally, FWIW, I have heard tales of considerable speedup from
people being able to avoid using FKs/lookup tables by using enums.

cheers

andrew

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Decibel! 2007-08-31 15:39:19 Re: Password requirement in windows installer
Previous Message Tom Lane 2007-08-31 15:00:21 Re: [HACKERS] enum types and binary queries

Browse pgsql-patches by date

  From Date Subject
Next Message Decibel! 2007-08-31 17:17:14 Re: enum types and binary queries
Previous Message Tom Lane 2007-08-31 15:00:21 Re: [HACKERS] enum types and binary queries