Re: vacuumdb for schema only - Mailing list pgsql-admin

From Fabrízio de Royes Mello
Subject Re: vacuumdb for schema only
Date
Msg-id AANLkTinMzvVZAvADjnH-2a=ph2eZSJQvo80WLetqDH0Y@mail.gmail.com
Whole thread Raw
In response to vacuumdb for schema only  (Isabella Ghiurea <isabella.ghiurea@nrc-cnrc.gc.ca>)
Responses Re: vacuumdb for schema only  (Bèrto ëd Sèra <berto.d.sera@gmail.com>)
List pgsql-admin

2010/9/7 Isabella Ghiurea <isabella.ghiurea@nrc-cnrc.gc.ca>
Hi List,
I would like to know if there is an option to run full vacuumdb  for a specific schema only, I see there is  option for tables or whole db .


No, but you can do like this using "psql" :

psql -U postgres -t -A -c "select 'VACUUM '||table_schema||'.'||table_name||';' from information_schema.tables where table_schema = 'public'" bdteste | psql -U postgres bdteste

The example above will run VACUUM to all tables in schema called 'public' in 'bdteste' database.

Best regards,

--
Fabrízio de Royes Mello
>> Blog sobre TI: http://fabriziomello.blogspot.com

pgsql-admin by date:

Previous
From: Isabella Ghiurea
Date:
Subject: vacuumdb for schema only
Next
From: Jesper Krogh
Date:
Subject: Re: [NOVICE] - SAN/NAS/DAS - Need advises