Re: Comparing arrays

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bertrand Petit <pgsql-sql(at)phoe(dot)frmug(dot)org>
Cc: PostgreSQL-sql <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Comparing arrays
Date: 2003-08-09 14:34:07
Message-ID: 5328.1060439647@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Bertrand Petit <pgsql-sql(at)phoe(dot)frmug(dot)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

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Bruno Wolff III 2003-08-09 15:08:09 Re: How to check: is some key referenced from sometable
Previous Message Bertrand Petit 2003-08-09 10:12:12 Comparing arrays