Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UfbP2-0002xT-VQ for pgsql-general@arkaria.postgresql.org; Thu, 23 May 2013 19:42:21 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1UfbP2-0005oy-5O for pgsql-general@arkaria.postgresql.org; Thu, 23 May 2013 19:42:20 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UfbOz-0005md-FL for pgsql-general@postgresql.org; Thu, 23 May 2013 19:42:17 +0000 Received: from cerberus.pinpointresearch.com ([66.7.238.130] helo=polaris.pinpointresearch.com) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1UfbOs-0004DP-Tf for pgsql-general@postgresql.org; Thu, 23 May 2013 19:42:16 +0000 Received: from [192.168.1.179] (betelgeuse.pinpointresearch.com [192.168.1.179]) by polaris.pinpointresearch.com (Postfix) with ESMTP id 73F78E00EC82; Thu, 23 May 2013 12:42:10 -0700 (PDT) Message-ID: <519E7117.9000402@pinpointresearch.com> Date: Thu, 23 May 2013 12:42:15 -0700 From: Steve Crawford User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130510 Thunderbird/17.0.6 MIME-Version: 1.0 To: Pascal Tufenkji CC: pgsql-general@postgresql.org Subject: Re: Temp tables References: <008f01ce5786$8a6f57b0$9f4e0710$@usj.edu.lb> In-Reply-To: <008f01ce5786$8a6f57b0$9f4e0710$@usj.edu.lb> Content-Type: multipart/alternative; boundary="------------060000090307000009010703" X-Pg-Spam-Score: -0.3 (/) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-general Precedence: bulk Sender: pgsql-general-owner@postgresql.org This is a multi-part message in MIME format. --------------060000090307000009010703 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit On 05/23/2013 12:24 AM, Pascal Tufenkji wrote: > > Hi, > > To enhance the performance of the queries, I use temp tables in my > website reports. > > It seems that a temp table has not been dropped automatically in a > certain session, and now the report is giving an error since the temp > table already exists ?! > > When I type the following, the database gives me an error: > > dragon=# CREATE TEMP TABLE _parcours (id int); > > ERROR: type "_parcours" already exists > > 1.How can I identify the session in which the temp table is still > locked, so I can drop it manually > > 2.Why does those cases happen and the temp tables don't drop automatically > Two questions: 1. Is that the exact message you are getting. I would expect *relation* "_parcours" already exists not *type*. 2. Are you using persistent connections or connection pooling? It feels a bit like there is something leftover from a previous process that was using the same connection. Cheers, Steve --------------060000090307000009010703 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit
On 05/23/2013 12:24 AM, Pascal Tufenkji wrote:

Hi,

 

To enhance the performance of the queries, I use temp tables in my website reports.

It seems that a temp table has not been dropped automatically in a certain session, and now the report is giving an error since the temp table already exists ?!

 

When I type the following, the database gives me an error:

dragon=# CREATE TEMP TABLE _parcours (id int);

ERROR:  type "_parcours" already exists

 

1.       How can I identify the session in which the temp table is still locked, so I can drop it manually

2.       Why does those cases happen and the temp tables don’t drop automatically


Two questions:

1. Is that the exact message you are getting. I would expect *relation* "_parcours" already exists not *type*.

2. Are you using persistent connections or connection pooling?

It feels a bit like there is something leftover from a previous process that was using the same connection.

Cheers,
Steve

--------------060000090307000009010703--