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

Re: Is it possible to query the database for the values of an enumerated type in 8.3.3?

From: "Nagle, Gail A \(US SSA\)" <gail(dot)nagle(at)baesystems(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Is it possible to query the database for the values of an enumerated type in 8.3.3?
Date: 2008-12-19 00:58:35
Message-ID: 7b4bbp$1jnkee@dmzms99802.na.baesystems.com (view raw or flat)
Thread:
Lists: 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(at)sss(dot)pgh(dot)pa(dot)us] 
Sent: Thursday, December 18, 2008 5:33 AM
To: Nagle, Gail A (US SSA)
Cc: pgsql-novice(at)postgresql(dot)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(dot)nagle(at)baesystems(dot)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

Next:From: Nagle, Gail A (US SSA)Date: 2008-12-19 01:00:08
Subject: Re: Is it possible to query the database for the values of an enumerated type in 8.3.3?
Previous:From: Emil ObermayrDate: 2008-12-18 20:54:13
Subject: Re: SQL Question

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