Re: Vacuum all tables unders under one schema (not under one database)

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: emilu(at)cs(dot)concordia(dot)ca
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Vacuum all tables unders under one schema (not under one database)
Date: 2006-01-10 04:29:47
Message-ID: 20060110042947.GA41490@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, Jan 09, 2006 at 11:39:09AM -0500, Emi Lu wrote:
> I'd like to vacuum all tables under a specific schema. Instead of
> specifying tables one by one under the schema (not one Database), is
> there a simple way to do it?

VACUUM works either on a specific table or on an entire database;
it doesn't have an option to vacuum a subset of tables such as all
those in a particular schema. VACUUM also isn't allowed in server-side
functions so you can't write a function to do the job. You could,
however, write a simple client application to query the system
catalogs and vacuum each table in a particular schema. Maybe that
would be a useful option to add to vacuumdb.

Another possibility would be to use autovacuum.

--
Michael Fuhr

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Guy Rouillier 2006-01-10 05:00:17 Re: read txt and insert table
Previous Message Matthew Peter 2006-01-10 04:10:51 Re: Passing a list of values to a function