Re: [GENERAL] Coercing compound types to use generic ROW comparison operators

2007-10-12 Thread Merlin Moncure
On 10/12/07, Tom Lane <[EMAIL PROTECTED]> wrote: > "Merlin Moncure" <[EMAIL PROTECTED]> writes: > > AIUI, the biggest problem with the current behavior is that there is > > no way to usefully index composite types, it looks like > > > create index bar_idx on bar(f); > > create index bar_idx on bar(

Re: [GENERAL] Coercing compound types to use generic ROW comparison operators

2007-10-12 Thread Tom Lane
"Merlin Moncure" <[EMAIL PROTECTED]> writes: > AIUI, the biggest problem with the current behavior is that there is > no way to usefully index composite types, it looks like > create index bar_idx on bar(f); > create index bar_idx on bar((f).*); > create index bar_idx on bar((f).a, (f).b); The la

Re: [GENERAL] Coercing compound types to use generic ROW comparison operators

2007-10-12 Thread Merlin Moncure
On 10/11/07, Tom Lane <[EMAIL PROTECTED]> wrote: > Randall Lucas <[EMAIL PROTECTED]> writes: > > Still, this would fail in a nested situation because it wouldn't > > recurse (if col1 of the compound type were another compound type, > > ferinstance), as would your suggestion above. It might be wort

Re: [GENERAL] Coercing compound types to use generic ROW comparison operators

2007-10-11 Thread Tom Lane
Randall Lucas <[EMAIL PROTECTED]> writes: > Still, this would fail in a nested situation because it wouldn't > recurse (if col1 of the compound type were another compound type, > ferinstance), as would your suggestion above. It might be worthwhile > to allow choosing to use the default ROW compari

Re: [GENERAL] Coercing compound types to use generic ROW comparison operators

2007-10-11 Thread Randall Lucas
On Thu, Oct 11, 2007 at 02:52:08PM -0400, Tom Lane wrote: > Randall Lucas <[EMAIL PROTECTED]> writes: > > 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 e

Re: [GENERAL] Coercing compound types to use generic ROW comparison operators

2007-10-11 Thread Tom Lane
Randall Lucas <[EMAIL PROTECTED]> writes: > 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? Well, you can do this ... regression=# creat

[GENERAL] Coercing compound types to use generic ROW comparison operators

2007-10-10 Thread Randall Lucas
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 compariso