Re: plpgsql and logical expression evaluation

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: wstrzalka <wstrzalka(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: plpgsql and logical expression evaluation
Date: 2008-04-24 15:10:44
Message-ID: 28885.1209049844@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

wstrzalka <wstrzalka(at)gmail(dot)com> writes:
> So - does it mean that the whole IF-ELSE-ENDIF is not parsed at once -
> but lazy-parsed when the control reaches it, while the IF condition is
> parsed as a single expression and therefore I get error in this case?

Right, for a suitable definition of "parsed". There is some trivial
syntax checking that happens early (eg, you'll see complaints for
mismatched parentheses) but actually trying to determine the meaning
of an expression happens when control first gets there.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2008-04-24 15:18:06 Re: WAL shipping with archive_timeout & pg_switch_xlog()
Previous Message Scott Marlowe 2008-04-24 15:06:07 Re: error connecting to database: could not open relation