Re: Comparing arrays - Mailing list pgsql-sql

From Tom Lane
Subject Re: Comparing arrays
Date
Msg-id 5328.1060439647@sss.pgh.pa.us
Whole thread Raw
In response to Comparing arrays  (Bertrand Petit <pgsql-sql@phoe.frmug.org>)
List pgsql-sql
Bertrand Petit <pgsql-sql@phoe.frmug.org> writes:
> That query can't be planed because of the following error: "Unable to
> identify an ordering operator '<' for type 'character varying[]'".

This shortcoming is (at long last) repaired for 7.4.  There is no simple
solution in earlier releases, I fear.

> I'm signaled that the array_out procedure is not defined: "ERROR:
> TypeCreate: function array_out(attributes) does not exist". That error
> sounds strange as the CREATE TYPE manual describes uniform array type
> creation as illustrated above and that array_out() seems to exist as
> shown bellow.

CREATE TYPE wants an *exact* match of the argument/result datatypes.
You could fake it out by creating another pg_proc row pointing at the
same internal procedure.  However, I think creating a private datatype
is the hard way to go about this.  A better short-run solution is just
to create = and < operators for varchar[].
        regards, tom lane


pgsql-sql by date:

Previous
From: Bruno Wolff III
Date:
Subject: Re: How to check: is some key referenced from sometable
Next
From: Joe Conway
Date:
Subject: Re: Comparing arrays