Re: SEGV in contrib/array/array_iterator.c - Mailing list pgsql-bugs

From Tom Lane
Subject Re: SEGV in contrib/array/array_iterator.c
Date
Msg-id 26706.1017772167@sss.pgh.pa.us
Whole thread Raw
In response to SEGV in contrib/array/array_iterator.c  (Matt Peterson <matt@caldera.com>)
Responses Re: SEGV in contrib/array/array_iterator.c  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
List pgsql-bugs
Matt Peterson <matt@caldera.com> writes:

> +     if(value == 0)
> +     {
> +         /* elog(NOTICE, "array_iterator: value is null"); */
> +               return (0);
> +     }

This patch is certainly wrong, as it will break array_iterator for
non-pointer datatypes (no, I do not believe your assertion to the
contrary).

More to the point, inserting explicit tests for null is an obsolete
approach; the preferred way to do things these days is to mark the SQL
declarations of such functions with "isStrict".  Would you instead
update contrib/array to rely on isStrict?

It'd be even nicer to update contrib/array to V1 calling conventions,
but unless you are hitting 64-bit porting problems that may not do
anything useful for you...

            regards, tom lane

pgsql-bugs by date:

Previous
From: "Vlad Marchenko"
Date:
Subject: Re: huh!?
Next
From: "Konrad Gdowski"
Date:
Subject: date function 'age' problem