Обсуждение: SELECT 'pg_catalog.pg_class'::regclass::oid

Поиск
Список
Период
Сортировка

SELECT 'pg_catalog.pg_class'::regclass::oid

От
"Tom Hebbron"
Дата:
Hi list,

test=# SELECT 'pg_catalog.pg_class'::regclass::oid;
 oid
------
 1259
(1 row)

test=# SELECT '1259'::oid::regclass;
 regclass
----------
 pg_class
(1 row)

test=# SELECT '1259'::oid::regclass::text || '.relname';
ERROR:  cannot cast type regclass to text
test=#

Could the regclass psuedo-type give schema qualified output when given an
oid, and could it be castable to text please - it would make life easier?