Danny Aldham <danny(at)lennon(dot)postino(dot)com> writes:
> I am wondering if anyone has a decent method of cleaning up
> these temporary tables after use.
> I am considering creating a table called Temp_Tables, and inserting the
> name of the temp_tables into it, and having a cron job read Temp_Tables
> for a list of temp_tables to drop. Any other suggestions are appreciated.
Are you able to choose the table names freely? If so, consider encoding
the needed info right into the table name:
(I'm imagining the current timestamp and PID as the variable components
here, but you could alter that to suit your needs.) Then a scan of
pg_class tells the cron job what to do. This avoids the overhead of an
extra table insert/delete, and more importantly avoids any possibility of
the Temp_Tables table getting out of sync with reality.
regards, tom lane
In response to
pgsql-novice by date
|Next:||From: Ewald Geschwinde||Date: 2001-11-30 16:40:36|
|Subject: what's this debug mean?|
|Previous:||From: Brett W. McCoy||Date: 2001-11-30 15:04:44|
|Subject: Re: Logging|