How to determine the operator class that an operator belongs to

Поиск
Список
Период
Сортировка
От Marc Munro
Тема How to determine the operator class that an operator belongs to
Дата
Msg-id 1256413562.19701.16.camel@bloodnok.com
обсуждение исходный текст
Ответы Re: How to determine the operator class that an operator belongs to
Список pgsql-general
I'm trying to reconstruct create operator class statements from the
catalogs.  My problem is that access method operators are related only
to their operator families.

My current assumtion is that all operators for an operator class will
have the same left and right operand types as the data type (opcintype)
of the operator class, or will be None.

Here is my query:
-- List all operator family operators.
select am.amopfamily as family_oid,
       oc.oid as class_oid
from   pg_catalog.pg_amop am
inner join pg_catalog.pg_operator op
  on  op.oid = am.amopopr
left outer join pg_catalog.pg_opclass oc
  on  oc.opcfamily = am.amopfamily
  and (oc.opcintype = op.oprleft or op.oprleft = 0)
  and (oc.opcintype = op.oprright or op.oprright = 0)

Is my assumption correct?  Does the query seem correct?

Thanks in advance.

__
Marc

В списке pgsql-general по дате отправления:

Предыдущее
От: Bruno Baguette
Дата:
Сообщение: Re: How can I get one OLD.* field in a dynamic query inside a trigger function ?
Следующее
От: Tawita Tererei
Дата:
Сообщение: Re: is postgres a good solution for billion record data.. what about mySQL?