Re: PL/pgSQL question

From: Jan Wieck <JanWieck(at)Yahoo(dot)com>
To: Michael Paesold <mpaesold(at)gmx(dot)at>
Cc: Michael Meskes <meskes(at)postgresql(dot)org>, PostgreSQL Hacker <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: PL/pgSQL question
Date: 2002-09-19 19:46:05
Message-ID: 3D8A297D.28193A53@Yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Michael Paesold wrote:
>
> Michael Meskes wrote:
>
> > Hi,
> >
> > is a pl/pgSQL function completely parsed once? Or is only the next
> > statement parsed as with many interpreters? If it's the latter it would
> > mean one has to run each branch just to see if the syntax is correct. Is
> > that true?
> >
> > Michael
>
> If the docs are true, than the plain PL/pgSQL code is parsed at once,
> but SQL expressions and queries are not prepared until the branch is
> used. But read for yourself.

That's the way I implemented it. Unless someone changed it, the
documentation is correct.

Someone might think now it'd be at least handy to have a mechanism to
enforce parsing of all expressions and queries for debugging purposes.
But that's not that easy. As soon as you use for example a record
variable, each reference to one of the result row columns is of unknown
datatype until that query is actually executed. You cannot parse an SQL
query with unknown parameters via SPI.

Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me. #
#================================================== JanWieck(at)Yahoo(dot)com #

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Oleg Bartunov 2002-09-19 20:19:15 Re: Inconsistent Conversion Names
Previous Message Michael Paesold 2002-09-19 19:20:53 Re: PL/pgSQL question