WHERE typname = ?
EOF
if ($typetype && $typetype eq 'e') {
- # The following will extract a list of allowed values for the
- # enum.
+ # The following will extract a list of allowed values for the enum.
my $order_column = $self->dbh->{pg_server_version} >= 90100 ? 'enumsortorder' : 'oid';
- my $typevalues = $self->dbh
- ->selectall_arrayref(<<EOF, {}, $info->{data_type});
+ $info->{extra}{list} = $self->dbh
+ ->selectcol_arrayref(<<EOF, {}, $info->{data_type});
SELECT e.enumlabel
FROM pg_catalog.pg_enum e
JOIN pg_catalog.pg_type t ON t.oid = e.enumtypid
ORDER BY e.$order_column
EOF
- $info->{extra}{list} = [ map { $_->[0] } @$typevalues ];
-
# Store its original name in extra for SQLT to pick up.
$info->{extra}{custom_type_name} = $info->{data_type};