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:
But, as Tom said, you can probably rephrase the function to not use a
temp table anymore.
pgsql-jdbc by date
|Next:||From: Bhushan Bhangale||Date: 2004-03-03 15:15:21|
|Subject: Re: calling function |
|Previous:||From: Sean Elliott||Date: 2004-03-03 10:33:27|
|Subject: Passing date and smallint (etc) parameters to functions from Java|