Skip site navigation (1) Skip section navigation (2)

Re: query first time works second time fails for one connection

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Rahul_g(at)ip(dot)eth(dot)net, pgsql-bugs(at)postgresql(dot)org
Subject: Re: query first time works second time fails for one connection
Date: 2001-08-01 16:28:00
Message-ID: 10152.996683280@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-bugs
Temp tables don't interact well with plpgsql's attempts to cache query
plans for the queries in its functions.  This is a bug, but a solution
is not close at hand.

In 7.1, you can work around this by using EXECUTE to execute the queries
on the temp table, thus forcing a re-plan on every execution.  Ugly but
serviceable.

Another possibility is to create the temp table only once per session,
outside the function itself.  The function can just DELETE FROM the
table to clear it for re-use on each call.

			regards, tom lane

In response to

pgsql-bugs by date

Next:From: Darin FisherDate: 2001-08-01 17:27:03
Subject: Too many open files
Previous:From: rychuDate: 2001-08-01 15:45:07
Subject: Odpowied automatyczna

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group