Re: help using arrays in a function - Mailing list pgsql-general

From Joe Conway
Subject Re: help using arrays in a function
Date
Msg-id 403E6300.6090908@joeconway.com
Whole thread Raw
In response to help using arrays in a function  ("Jennifer Lee" <jlee@scri.sari.ac.uk>)
List pgsql-general
Jennifer Lee wrote:
>            WHILE a[i] LOOP

This problem has nothing to do with arrays, per se. PL/pgSQL no longer
assumes it can coerce an integer constant to a boolean. Instead make the
above line look like this:

              WHILE a[i] IS NOT NULL LOOP


BTW, in 7.4 you could more easily get the same result like this:

regression=# select 82 = any ('{100,92,82}');
  ?column?
----------
  t
(1 row)

regression=# select 82 = any ('{100,92}');
  ?column?
----------
  f
(1 row)

See:
http://www.postgresql.org/docs/current/static/functions-comparisons.html

HTH,

Joe

pgsql-general by date:

Previous
From: Erwin Van de Velde
Date:
Subject: Postmasters pile up
Next
From: "Keith Bottner"
Date:
Subject: Re: Postgres clustering?