Re: analyze-error: "cannot compare arrays of different element types" revisited

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Florian G(dot) Pflug" <fgp(at)phlo(dot)org>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: analyze-error: "cannot compare arrays of different element types" revisited
Date: 2004-12-17 21:09:28
Message-ID: 24011.1103317768@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Florian G. Pflug" <fgp(at)phlo(dot)org> writes:
> Since postgres disallows empty array literals (array[] gives an syntax
> error), I guess creating empty array by removing the last element is
> quite hackish too... Will empty arrays be eventually supported, or will
> they be forbidden entirely (e.g, making "array[1] - 1" return null)?

They're supported now, but you have to write something like
'{}'::int8[]
since "array[]" doesn't provide any context for guessing the intended
array element type.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Bruno Wolff III 2004-12-17 21:12:18 Re: sorting problem
Previous Message Tom Lane 2004-12-17 21:06:25 Re: analyze-error: "cannot compare arrays of different element types" revisited