Re: Is it possible to query the database for the values of an enumerated type in 8.3.3? - Mailing list pgsql-novice

From Nagle, Gail A \(US SSA\)
Subject Re: Is it possible to query the database for the values of an enumerated type in 8.3.3?
Date
Msg-id 7b4bbp$1jnkee@dmzms99802.na.baesystems.com
Whole thread Raw
In response to Is it possible to query the database for the values of an enumerated type in 8.3.3?  ("Nagle, Gail A \(US SSA\)" <gail.nagle@baesystems.com>)
List pgsql-novice
Hello Tom,

Works like a charm. Enum is a better search string than enumerate(d)!

Thank you and much obliged,
Gail
-----Original Message-----
From: Tom Lane [mailto:tgl@sss.pgh.pa.us]
Sent: Thursday, December 18, 2008 5:33 AM
To: Nagle, Gail A (US SSA)
Cc: pgsql-novice@postgresql.org
Subject: Re: [NOVICE] Is it possible to query the database for the
values of an enumerated type in 8.3.3?

"Nagle, Gail A \(US SSA\)" <gail.nagle@baesystems.com> writes:
> Is it possible to query the database (e.g. from psql or from the
pgAdmin
> III Query tool) for the enumerated values in the newly added user
> defined type?

regression=# create type myenum as enum ('red','green','blue');
CREATE TYPE
regression=# select enumlabel from pg_enum where enumtypid =
'myenum'::regtype order by oid;
 enumlabel
-----------
 red
 green
 blue
(3 rows)

http://www.postgresql.org/docs/8.3/static/catalog-pg-enum.html

            regards, tom lane


pgsql-novice by date:

Previous
From: Emil Obermayr
Date:
Subject: Re: SQL Question
Next
From: "Nagle, Gail A \(US SSA\)"
Date:
Subject: Re: Is it possible to query the database for the values of an enumerated type in 8.3.3?