PGA3 Operator Question

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

PGA3 Operator Question

От:
efesar <efesar@nmia.com>
Дата:
Dave et al,

* This is a temporary solution until the cache is built.

I need to get a list of operators from the database that will return only
booleans types, not integer types. This is basically a list of possible
"join" operators.

This is the query I've found works the best. Do namespaces matter here? Can
anybody suggest a better query?

	SELECT DISTINCT
		a.oprname
	FROM
		pg_operator a
	JOIN
		pg_type b on ( a.oprresult = b.oid )
	WHERE
		a.oprkind = 'b' and b.typname = 'bool'
	ORDER BY
		a.oprname

-Keith

Re: PGA3 Operator Question

От:
"Dave Page" <dpage@vale-housing.co.uk>
Дата:


> -----Original Message-----
> From: efesar [mailto:efesar@nmia.com] 
> Sent: 03 April 2003 01:52
> To: Pgadmin-Hackers
> Subject: [pgadmin-hackers] PGA3 Operator Question
> 
> 
> Dave et al,
> 
> * This is a temporary solution until the cache is built.
> 
> I need to get a list of operators from the database that will 
> return only booleans types, not integer types. This is 
> basically a list of possible "join" operators.
> 
> This is the query I've found works the best. Do namespaces 
> matter here? Can anybody suggest a better query?
> 
> 	SELECT DISTINCT
> 		a.oprname
> 	FROM
> 		pg_operator a
> 	JOIN
> 		pg_type b on ( a.oprresult = b.oid )
> 	WHERE
> 		a.oprkind = 'b' and b.typname = 'bool'
> 	ORDER BY
> 		a.oprname

Hi Keith,

Namespaces do matter because unless the opr is in the search path then
it won't be found, and even then, if there are 2 in different schemas
then the search path will determine which is to be used unless they are
qualified (ie. OPERATOR(pg_catalog.+) ).

Query looks OK at a cursory examination.

Regards, Dave.

FAQ