pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Itai Zukerman <zukerman@math-hat.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: Polymorphic?
Date: Tue, 25 Feb 2003 11:20:11 -0500
Message-ID: <10960.1046190011@sss.pgh.pa.us> (raw)
In-Reply-To: <87lm041jnq.fsf@matt.w80.math-hat.com>
References: <87lm041jnq.fsf@matt.w80.math-hat.com>

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



view thread (3+ messages)  latest in thread

Message-ID: <10960.1046190011@sss.pgh.pa.us>
Permalink:  ../10960.1046190011@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/10960.1046190011@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, zukerman@math-hat.com
  Subject: Re: Polymorphic?
  In-Reply-To: <10960.1046190011@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox