stale temporary tables

From: "thimoty(at)thimoty(dot)it" <thimoty(at)thimoty(dot)it>
To: pgsql-general(at)postgresql(dot)org <pgsql-general(at)postgresql(dot)org>
Subject: stale temporary tables
Date: 2002-09-30 13:43:22
Message-ID: H397GA$INlhIWp9UQ9UeaMkXo3cWS0aMU1guAqEMo9JsrHd0xFB0@webmessenger.it
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello all,
i don't know if there is a quicker way, but i ended up in having
40,000 or so
stale temp tables from a Java application which is using postgres as
backend.

what i did is the following:
1) run postmaster with -o -O
2) type \dS and put the result to a file (list of all the temp tables,
all still there!)
3) create a sql file to drop the tables like this
cut -f1 -d\| staletables.txt | grep pg_temp | sed '/pg_temp.[0-9]*.[0-9]
*/s//DROP TABLE "&";/' > droptables.sql
4) from pgsql run \i droptables.sql

isn't there any switch or command in VACUUM that does it?

Regards
Tim

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bruno Wolff III 2002-09-30 13:57:33 Re: [SQL] arrays
Previous Message Achilleus Mantzios 2002-09-30 13:18:54 Re: [SQL] arrays