Re: plpgsql: Bush becomes a null, can not execute null query

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Mauri(dot)Sahlberg(at)pretax(dot)net
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: plpgsql: Bush becomes a null, can not execute null query
Date: 2003-08-28 13:33:17
Message-ID: 10442.1062077597@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Mauri Sahlberg <Mauri(dot)Sahlberg(at)claymountain(dot)com> writes:
> If the following is executed in context, where the dynamic query returns
> data with every iteration everythin goes fine. If the the dynamic query
> returns nothing - bush becomes null and everything fails. I do not
> undestand why bush becomes null when the query returns nothing.

If "latest" is null then the result of the series of concatenations is
also null. Perhaps what you really want is to assign to "latest" inside
the inner FOR-loop.

regards, tom lane

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Ludwig Heusser 2003-08-28 14:24:50 No user restriction, Why?
Previous Message Daniel Michał 2003-08-28 12:28:49 postgresql and lock an row