Re: array[10] - Mailing list pgsql-admin

From Joe Conway
Subject Re: array[10]
Date
Msg-id 3F392ACE.1020201@joeconway.com
Whole thread Raw
In response to array[10]  (Marco Kaerger <m.kaerger@vitrado.de>)
List pgsql-admin
Marco Kaerger wrote:
> hi there,
>
> i have got a problem concerning arrays in postgres
> i created a function in which i want to know if the index 8 of var_array
> ist not NULL:
>
> IF var_array[8] IS NOT NULL
>
>     THEN
>
>     (query)
>
>     END IF;
>
>
> then i call the function and the query is submitted, allthough
> var_array[8] is 'NULL'
>

 From your question it appears that you think 'NULL' (with single
quotes) and NULL (without single quotes) are the same thing -- they are
not. The string literal 'NULL' is nothing more than a four letter
string. NULL, on the other hand, is a special value meaning that the
data is unknown.

Currently Postgres does not even support NULL elements in arrays,
although if you test for a non-existing subscript the result is NULL.

Why don't you give us a complete (i.e. the entire function) example of
what you are trying to do, along with the specific query you believe
gives the wrong result, and then maybe we can be of more help.

Joe


pgsql-admin by date:

Previous
From: Murthy Kambhampaty
Date:
Subject: Re: Backup routine
Next
From: pradeep krishna
Date:
Subject: Database in postgresql