Re: ENUM type

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Jim C(dot) Nasby" <decibel(at)decibel(dot)org>
Cc: Jochem van Dieten <jochemd(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: ENUM type
Date: 2005-07-27 03:37:45
Message-ID: 21137.1122435465@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-advocacy pgsql-hackers

"Jim C. Nasby" <decibel(at)decibel(dot)org> writes:
> ... what I was wondering about is creating a
> 'type' that is a rollup for:

> - create parent table with int id field and text and indexes
> - add RI to base table
> - add triggers/views/rules/other glue to make the id field hidden and
> transparent to users in normal uses

Given the difficulties we've had with SERIAL columns, this seems much
less than trivial :-(. I'd be interested to see a good solution ---
I suspect it needs one or two ideas we haven't had yet.

In the meantime, I agree with Andrew's reply that the best stopgap is to
invent a bespoke datatype for each required ENUM set, with input and
output functions that have the list of values hardwired in.

regards, tom lane

In response to

Responses

Browse pgsql-advocacy by date

  From Date Subject
Next Message Jeff Davis 2005-07-27 03:59:11 Re: [HACKERS] Enticing interns to PostgreSQL
Previous Message Andrew Dunstan 2005-07-26 23:57:49 Re: ENUM type

Browse pgsql-hackers by date

  From Date Subject
Next Message Gavin Sherry 2005-07-27 03:47:25 Duplicate object names in GRANT
Previous Message Andrew Dunstan 2005-07-27 03:13:19 Re: Couple of minor buildfarm issues