Search Postgresql Archives

Coercing compound types to use generic ROW comparison operators

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I am storing a rowtype that keeps the primary key column(s) of another
table.  E.g., 

 create table point (x int, y int, stuff text, primary key
(x, y));

then, think:

 create type point_pk as (x int, y int).

When I go to compare point_pks against one another I get errors about
missing comparison operators.

HOWEVER, I can do this no problem:

 select row(1,2)=row(2,3);

I would REALLY like to be able to use the generic row comparison
functions, which, as detailed in the manual, are equivalent to
comparing elements left-to-right.

Is there a way I can convince my custom composite data type (point_pk)
to use the row-wise comparison functions, so that I don't have to
hackishly rewrite the comparison algorithm for each composite type?

Using 8.1.5.

Thanks,

Randall

-- 
Randall Lucas       Tercent, Inc.       DF93EAD1

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
       choose an index scan if your joining column's datatypes do not
       match

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux