Re: calling function

From: James Robinson <jlrobins(at)socialserve(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org
Cc: <bbhangale(at)Lastminute(dot)com>
Subject: Re: calling function
Date: 2004-03-03 14:55:08
Message-ID: C35AA7B8-6D22-11D8-971F-000A9566A412@socialserve.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Standard queries in plpgsql are parsed / planned only once per backend
session, and the plan stores the object ids of the relations used in
the query, not the names. So, when you drop the table, the cached plan
becomes invalid. If your client disconnects / reconnects, then calls
the function, it will be parsed / planned again, and all is well --
that one time.

If you want to execute queries without having plans cached, you need to
make use of the execute command, the technique specified in section
37.6.4 of the postgres manual:

http://www.postgresql.org/docs/7.4/static/plpgsql-statements.html

But, as Tom said, you can probably rephrase the function to not use a
temp table anymore.

----
James Robinson
Socialserve.com

Browse pgsql-jdbc by date

  From Date Subject
Next Message Bhushan Bhangale 2004-03-03 15:15:21 Re: calling function
Previous Message Sean Elliott 2004-03-03 10:33:27 Passing date and smallint (etc) parameters to functions from Java