pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: cnliou@eurosport.com
To: pgsql-sql@postgresql.org
Subject: Re: PL/pgSQL examples NOT involving functions
Date: Wed, 28 Nov 2001 00:34:09 GMT
Message-ID: <200111280034.09d3@lh00.opsion.fr> (raw)

Hello!

> envisity=# create table temp (tempid integer);
> CREATE
> envisity=# INSERT INTO temp VALUES(1);
> 
> CREATE FUNCTION test3() RETURNS INTEGER AS 'DECLARE
id INTEGER; BEGIN SELECT INTO id tempid FROM temp
LIMIT 1; RETURN id; END;' LANGUAGE 'plpgsql';
> DROP
> CREATE
> envisity=# select test3();
>  test3
> -------
>      1
> (1 row)
> 
> envisity=# DROP TABLE temp ;
> DROP
> envisity=# create table temp (tempid integer);
> CREATE
> envisity=# INSERT INTO temp VALUES(3);
> INSERT 150371 1
> envisity=# select test3();
> ERROR:  Relation 150348 does not exist

If I exit plpgsql and reenter, then "select test3()"
works again. So I guess "the first time" in

"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."

might be referring to "for each client connection".

CN

--------------------------------------------------------
You too can have your own email address from Eurosport.
http://www.eurosport.com








view thread (23+ messages)  latest in thread

Message-ID: <200111280034.09d3@lh00.opsion.fr>
Permalink:  ../200111280034.09d3@lh00.opsion.fr/
Also on:    postgresql.org/message-id/200111280034.09d3@lh00.opsion.fr

 · 

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-sql@postgresql.org
  Cc: cnliou@eurosport.com
  Subject: Re: PL/pgSQL examples NOT involving functions
  In-Reply-To: <200111280034.09d3@lh00.opsion.fr>

* 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