Drop table wildcard

Поиск
Список
Период
Сортировка
Искать

Drop table wildcard

От:
Danny Aldham <danny@lennon.postino.com>
Дата:

I am working with some software that creates a lot of temporary tables
to store query returns. So after a few weeks I have over 200 tables
named tmp_123_some_number_etc . Is there a way from psql for me to
drop all the tables with names beginning with tmp_ ?
Thanks

-- 
Danny Aldham     Providing Certified Internetworking Solutions to Business
www.postino.com  E-Mail, Web Servers, Web Databases, SQL PHP & Perl

Re: Drop table wildcard

От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
Danny Aldham  writes:
> I am working with some software that creates a lot of temporary tables
> to store query returns. So after a few weeks I have over 200 tables
> named tmp_123_some_number_etc . Is there a way from psql for me to
> drop all the tables with names beginning with tmp_ ?

Why don't you make it create the tables as TEMP tables to begin with?
Then they'll go away by themselves.

			regards, tom lane
FAQ