Skip site navigation (1) Skip section navigation (2)

Re: wrong inicializied array in plpgsql

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Pavel Stehule <stehule(at)kix(dot)fsv(dot)cvut(dot)cz>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: wrong inicializied array in plpgsql
Date: 2003-09-14 17:41:47
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-bugs
Pavel Stehule <stehule(at)kix(dot)fsv(dot)cvut(dot)cz> writes:
> I am testing long array values. I tryed write simple function in plpgsql 
> for this. I found maybe a bug. Array in plpgsql without explicit init 
> (empty array) don't work;

This isn't a bug; or at least, it's not plpgsql's fault.  The array
variable is initially NULL, same as any other plpgsql variable you
didn't explicitly initialize.  And assigning to an element of a NULL
array yields another NULL array.

Perhaps that behavior should be changed, but I think it would require
making unsupported assumptions about what the user wants...

			regards, tom lane

In response to

pgsql-bugs by date

Next:From: Tom LaneDate: 2003-09-14 20:08:30
Subject: Re: PostgreSql 7.3.4 & 7.4 on MacOS X
Previous:From: Pavel StehuleDate: 2003-09-14 17:12:24
Subject: wrong inicializied array in plpgsql

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group