pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jan Wieck <janwieck@yahoo.com>
To: Aasmund Midttun Godal <postgresql@envisity.com>
Cc: josh@agliodbs.com
Cc: pgsql-sql@postgresql.org
Subject: Re: PL/pgSQL examples NOT involving functions
Date: Wed, 5 Dec 2001 16:26:47 -0500 (EST)
Message-ID: <200112052126.fB5LQlp01967@saturn.jw.home> (raw)
In-Reply-To: <20011127195917.10530.qmail@213-145-170-138.dd.nextgentel.com>

Aasmund Midttun Godal wrote:
> Erm, sorry about the multiple postings, I just discovered a couple of interesting tidbits after I posted first...
>
> http://www.postgresql.org/idocs/index.php?plpgsql.html :
>
> "The PL/pgSQL call handler parses the function's source text and produces an internal binary instruction tree the first time the function is called."

    And  that  is  still  not  entirely  accurate.  At  the first
    function call  the  control  language  (IF,  WHEN,  etc.)  is
    parsed.  All  expressions  and queries are just remembered as
    strings with variables replaced by $n parameters.  Now  every
    statement will prepare a saved plan the first time it is hit.

    So when you have a  function  with  conditional  code  and  a
    specific  branch of that code is never called, the statements
    in there will never be prepared.


Jan

--

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



_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com




view thread (21+ messages)  latest in thread

Message-ID: <200112052126.fB5LQlp01967@saturn.jw.home>
Permalink:  ../200112052126.fB5LQlp01967@saturn.jw.home/
Also on:    postgresql.org/message-id/200112052126.fB5LQlp01967@saturn.jw.home

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-docs@postgresql.org
  Cc: janwieck@yahoo.com, postgresql@envisity.com, josh@agliodbs.com, pgsql-sql@postgresql.org
  Subject: Re: PL/pgSQL examples NOT involving functions
  In-Reply-To: <200112052126.fB5LQlp01967@saturn.jw.home>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox