Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-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

pgsql-hackers by date

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

pgsql-patches by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group