| From: | Randall Lucas <rlucas(at)tercent(dot)com> |
|---|---|
| To: | pgsql-general(at)postgresql(dot)org |
| Subject: | Coercing compound types to use generic ROW comparison operators |
| Date: | 2007-10-11 01:49:59 |
| Message-ID: | 20071011014958.GN31362@ontology.tercent.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-general |
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
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Ow Mun Heng | 2007-10-11 02:08:33 | Re: pgodbc + Excel + msquery + background refresh |
| Previous Message | Guilherme | 2007-10-11 01:23:04 | drop table cascade doesn't drop manual sequences |