Is there a way to determine whether or not a user-defined type in PostgreSQL is an ENUM?
Essentially we have the following:
CREATE TYPE foo AS ENUM (
'Sometimes',
'You',
'Wanna',
'Go',
'Where Everybody Knows Your Name'
);
With a table instantiated by:
CREATE TABLE bar (
lyrics foo DEFAULT 'Wanna'::foo
);
I'm able to determine the type of foo
from the column lyrics
, however, I'm having trouble finding a way to determine whether or not foo
is an ENUM.
For context, I need this information to programmatically get a list of all possible values of foo
when given a column of lyrics
.