vacuum full for all databases

From: Ilia Chipitsine <ilia(at)paramon(dot)ru>
To: pgsql-general(at)postgresql(dot)org
Subject: vacuum full for all databases
Date: 2004-09-02 07:32:24
Message-ID: 20040902133023.V15260@office.paramon.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Dear Sirs

I'm about to write plpgsql function which will "vacuum full" all existing
databases. Below is an example how to get list of databases.

What should I write instead of "raise notice" ?

CREATE OR REPLACE FUNCTION vacuum_all() RETURNS integer
AS '
DECLARE
query text;
list RECORD;
BEGIN

FOR list IN SELECT datname FROM pg_catalog.pg_database WHERE NOT
datistemplate LOOP
raise notice ''datname = %'',list.datname;

END LOOP;

RETURN 0;

END;

'
LANGUAGE plpgsql;

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Peter Eisentraut 2004-09-02 07:59:49 Re: vacuum full for all databases
Previous Message chinni 2004-09-02 06:34:56 plpgsql function