Обсуждение: phpPgAdmin query help

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

phpPgAdmin query help

От
"Christopher Kings-Lynne"
Дата:
Hi guys,

I'm fixing the function editor in phpPgAdmin, however there's a problem.  We
use this query to return a list of all the possible function return types:

SELECT typname
FROM pg_type pt
WHERE typname NOT LIKE '\\\_%' AND typname NOT LIKE 'pg\\\_%'
EXCEPT
SELECT relname
FROM pg_class
WHERE relkind = 'S'
ORDER BY typname;

Part of this result is this:

bit
bool
box
...
text
tid
time
timestamp
timetz
tinterval
transactions_log

Now the problem is that if you have a function with a defined return type of
'boolean' or 'timestamp with time zone' or 'timestamp without time zone',
how on earth do you match it to something in this list?  Alternatively, how
do I query in all the _alias_ types?

Chris



Re: phpPgAdmin query help

От
Tom Lane
Дата:
"Christopher Kings-Lynne" <chriskl@familyhealth.com.au> writes:
> Now the problem is that if you have a function with a defined return type of
> 'boolean' or 'timestamp with time zone' or 'timestamp without time zone',
> how on earth do you match it to something in this list?

format_type(pg_type.oid, NULL) will deliver the prettified equivalent
name of each type.
        regards, tom lane