Search Postgresql Archives

Re: Referencing uninitialized variables in plpgsql

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"Karl O. Pinc" <kop@xxxxxxxx> writes:
> AFICT, the docs arn't clear when it comes to referencing unitialized
> array elements.  I assume you get NULL values here as well even
> though other array elements may have been given non-NULL values.

There is no such thing as an uninitialized array element.

Looking at array_ref, we do return a NULL if you try to fetch from a
position outside the current array subscript range.  But that's not
"uninitialized" in any normal sense of the word, it's more like
"nonexistent".  (I think you're right that it's undocumented behavior,
too.)

> Can I count on this?

Until someone makes an argument to change it ;-).

			regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
      subscribe-nomail command to majordomo@xxxxxxxxxxxxxx so that your
      message can get through to the mailing list cleanly

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux