Re: Polymorphic? - Mailing list pgsql-sql

From Tom Lane
Subject Re: Polymorphic?
Date
Msg-id 10960.1046190011@sss.pgh.pa.us
Whole thread Raw
In response to Polymorphic?  (Itai Zukerman <zukerman@math-hat.com>)
Responses Re: Polymorphic?  (Itai Zukerman <zukerman@math-hat.com>)
List pgsql-sql
Itai Zukerman <zukerman@math-hat.com> writes:
> I'd like to define a C function that takes two arguments of type
> "array of <fixed-length type>" and returns an INT4.  The function
> would make use of the <, <=, =, >=, > operators on the base type.  Any
> examples of or documentation on how to:

> 1.  Extract information about the underlying type from the arrays, in
>     particular the size of the type?
> 2.  Apply an operator from within C?

contrib/array might be a useful example of array manipulation.  As for
the other stuff, do you actually want to invoke those operators
specifically, or are you looking for sorting?  In any case you might
prefer to use any_ordering_op, SelectSortFunction and ApplySortFunction
rather than nailing down your own assumptions about what to compare
with.
        regards, tom lane


pgsql-sql by date:

Previous
From: Stephan Szabo
Date:
Subject: Re: Relation "pg_relcheck"
Next
From: Ian Barwick
Date:
Subject: Re: Relation "pg_relcheck"