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

Re: add label to enum syntax

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, "David E(dot) Wheeler" <david(at)kineticode(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: add label to enum syntax
Date: 2010-10-26 13:54:59
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers

On 10/26/2010 03:02 AM, Dean Rasheed wrote:
> In mathematics (and I think also computer science), the term
> conventionally used the refer to the things in an enumeration is
> "element", so how about ADD ELEMENT?

Unlike the other suggestions, ELEMENT is not currently a keyword. That 
doesn't rule it out entirely, but it's a factor worth consideration.

> The label is just one of the ways of identifying the element, and the
> value is element's OID. The thing you're adding is an element, with
> both a label and a value.

No, I think that's the wrong way of thinking about it entirely. The 
label *is* the value and the OID is simply an implementation detail, 
which for the most part we keep completely hidden from the user. We 
could have implemented enums in ways that did not involve OIDs at all, 
with identical semantics.

Notwithstanding the above, I don't think ELEMENT would be a very bad choice.



In response to


pgsql-hackers by date

Next:From: Steve SingerDate: 2010-10-26 14:04:54
Subject: Rollback sequence reset on TRUNCATE rollback patch
Previous:From: Hitoshi HaradaDate: 2010-10-26 13:35:16
Subject: Re: Range Types, discrete and/or continuous

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