Re: temp tables remain after server restart

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: temp tables remain after server restart
Дата
Msg-id 3957.1125516163@sss.pgh.pa.us
обсуждение исходный текст
Ответ на temp tables remain after server restart  (Hari Bhaskaran <hbhaskaran@gmail.com>)
Ответы Re: temp tables remain after server restart  (Hari Bhaskaran <hbhaskaran@gmail.com>)
Список pgsql-general
Hari Bhaskaran <hbhaskaran@gmail.com> writes:
> one of our programs went haywire and created around 200,000 temp
> tables. In the end, I restarted the db, but the temporary tables are
> still around

What did you do, the old "kill -9 some random process" approach to
database management?  The recommended ways of cancelling a session
wouldn't have caused this.

> What should I be doing to clean it up?

There is code to make them go away the first time a backend wants to use
the relevant pg_temp_xxxxx namespace.  So you could start a backend,
do "create temp table ...", start another backend while the first
remains running, do another "create temp table ...", repeat until they
go away.

It would probably work to do "drop schema pg_temp_xxxxx cascade" too,
but you'd have to be really careful not to clobber the temp schema of
an active backend this way.

            regards, tom lane

В списке pgsql-general по дате отправления:

Предыдущее
От: Frank
Дата:
Сообщение: Re: newbie - postgresql or mysql
Следующее
От: "Jim C. Nasby"
Дата:
Сообщение: Re: newbie - postgresql or mysql