Re: [HACKERS] Re: type coersion (was OR clause status) - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: [HACKERS] Re: type coersion (was OR clause status)
Date
Msg-id 199808110508.BAA21589@candle.pha.pa.us
Whole thread Raw
In response to Re: [HACKERS] Re: type coersion (was OR clause status)  (Bruce Momjian <maillist@candle.pha.pa.us>)
List pgsql-hackers
> test=> select * from pg_operator where oid = 1137;
>
oprname|oprowner|oprprec|oprkind|oprisleft|oprcanhash|oprleft|oprright|oprresult|oprcom|oprnegate|oprlsortop|oprrsortop|oprcode
>  |oprrest|oprjoin
>
-------+--------+-------+-------+---------+----------+-------+--------+---------+------+---------+----------+----------+---------+-------+---------
> =      |     139|      0|b      |t        |t         |     26|      23|
>      16|  1136|        0|         0|         0|oideqint4|eqsel
> |eqjoinsel (1 row)
>
>
> test=> select * from pg_operator where oid = 932;
>
oprname|oprowner|oprprec|oprkind|oprisleft|oprcanhash|oprleft|oprright|oprresult|oprcom|oprnegate|oprlsortop|oprrsortop|oprcode
>  |oprrest |oprjoin
>
-------+--------+-------+-------+---------+----------+-------+--------+---------+------+---------+----------+----------+---------+--------+------------
> =      |     139|      0|b      |t        |f         |    910|     910|
>      16|   932|      935|         0|         0|oidint4eq|intltsel|intltjoinsel (1 row)

I was wrong about the above entries.  oidint4eq is for a custom type
that is made up of and oid and an int4.  Strange but true.  Probably
should be removed.  Can't imagine why someone would use this.  Probably
used when we didn't have multi-key indexes or something.

Anyway, here is a query that shows the operators defined for access
methods.

    SELECT proname
    FROM pg_operator, pg_amop,pg_proc
    WHERE amopopr = pg_operator.oid AND
          RegprocToOid(pg_operator.oprcode) = pg_proc.oid;


Perhaps if i add oid am functions to use the int4 functions, it would
work.  int4int2eq assumes promotion of int2 to int4.  Should work.

proname
----------------
chareq
chareq
nameeq
nameeq
int2eq
int2eq
int2lt
int4eq
int4eq
int4lt
texteq
texteq
poly_left
poly_overleft
poly_overright
poly_right
poly_contained
poly_contain
poly_same
poly_overlap
box_left
box_left
box_overleft
box_overleft
box_overright
box_overright
box_right
box_right
box_contained
box_contained
box_contain
box_contain
box_same
box_same
box_overlap
box_overlap
int2gt
int4gt
int2le
int4le
int2ge
int4ge
int24eq
int42eq
int24lt
int42lt
int24gt
int42gt
int24le
int42le
int24ge
int42ge
abstimeeq
abstimelt
abstimegt
abstimele
abstimege
oideq
oideq
int4lt
int4gt
int4le
int4ge
float4eq
float4eq
float4lt
float4gt
float4le
float4ge
charlt
charle
chargt
charge
namelt
namele
namegt
namege
text_lt
text_le
text_gt
text_ge
float8eq
float8eq
float8lt
float8le
float8gt
float8ge
oidnamelt
oidnamele
oidnameeq
oidnamege
oidnamegt
oidint2lt
oidint2le
oidint2eq
oidint2ge
oidint2gt
oidint4lt
oidint4le
oidint4eq
oidint4ge
oidint4gt
bpchareq
bpchareq
bpcharlt
bpcharle
bpchargt
bpcharge
varchareq
varchareq
varcharlt
varcharle
varchargt
varcharge
date_eq
date_eq
date_lt
date_le
date_gt
date_ge
time_eq
time_eq
time_lt
time_le
time_gt
time_ge
datetime_eq
datetime_eq
datetime_lt
datetime_le
datetime_gt
datetime_ge
timespan_eq
timespan_eq
timespan_lt
timespan_le
timespan_gt
timespan_ge
circle_left
circle_overleft
circle_overright
circle_right
circle_contained
circle_contain
circle_same
circle_overlap
(146 rows)




--
Bruce Momjian                          |  830 Blythe Avenue
maillist@candle.pha.pa.us              |  Drexel Hill, Pennsylvania 19026
  +  If your life is a hard drive,     |  (610) 353-9879(w)
  +  Christ can be your backup.        |  (610) 853-3000(h)

pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] Re: type coersion (was OR clause status)
Next
From: "Thomas G. Lockhart"
Date:
Subject: Re: [HACKERS] Re: type coersion (was OR clause status)