X-Original-To: pgsql-sql@postgresql.org Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 2A21D475C60 for ; Tue, 25 Feb 2003 11:32:07 -0500 (EST) Received: from postgresql.org ([64.49.215.8]) by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with SMTP id 57558-10 for ; Tue, 25 Feb 2003 11:31:56 -0500 (EST) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by postgresql.org (Postfix) with ESMTP id 06814475E1F for ; Tue, 25 Feb 2003 11:20:08 -0500 (EST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.6/8.12.6) with ESMTP id h1PGKC5u010961; Tue, 25 Feb 2003 11:20:12 -0500 (EST) To: Itai Zukerman Cc: pgsql-sql@postgresql.org Subject: Re: Polymorphic? In-reply-to: <87lm041jnq.fsf@matt.w80.math-hat.com> References: <87lm041jnq.fsf@matt.w80.math-hat.com> Comments: In-reply-to Itai Zukerman message dated "Tue, 25 Feb 2003 10:09:45 -0500" Date: Tue, 25 Feb 2003 11:20:11 -0500 Message-ID: <10960.1046190011@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new X-Archive-Number: 200302/556 X-Sequence-Number: 11954 Itai Zukerman writes: > I'd like to define a C function that takes two arguments of type > "array of " 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