Search Postgresql Archives

Re: Prepared statement already exists

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2008-11-20 12:56, WireSpot wrote:
On Thu, Nov 20, 2008 at 10:56, Albe Laurenz <laurenz.albe@xxxxxxxxxx> wrote:
Do you still need the old prepared statement?

If not, you can simple DEALLOCATE it and then try the PREPARE again.

Yes, I'd like to keep the old statements, that's part of the perks --
if a query will be repeated it will (possibly) benefit from the
statement being already prepared.


So:

sql_md5 = md5(sql);
try {
	PREPARE sql_md5 AS sql;
} catch (SQLException e) {
	if (! e.getSQLState().equals("42P05")) {
		throw e;
	}
}
EXECUTE sql_md5;

Regards
Tometzky
--
...although Eating Honey was a very good thing to do, there was a
moment just before you began to eat it which was better than when you
were...
                                                      Winnie the Pooh

--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux