Re: Finding database names for overnight vacuum

From: "Oliver Elphick" <olly(at)lfix(dot)co(dot)uk>
To: Stephen Davies <scldad(at)sdc(dot)com(dot)au>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Finding database names for overnight vacuum
Date: 2001-08-20 09:57:38
Message-ID: 200108200957.f7K9vcma005989@linda.lfix.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Stephen Davies wrote:
>G'day all.
>
>I have a cron job which vacuums etc all of my databases but it does not
>work with 7.1.2 because of the change in structure of .../data/base.
>
>It currently says:
>
>for q in /usr/local/pgsql/data/base/*; do
>blaa
>blaa
>done
>
>How does one get an equivalent list of all databases from 7.1.2?
>(and where is it documented?)

psql -l

documented in psql man page

So for your purposes, you want:

$ psql -lt | awk '{print $1}' | grep -v template0
bray
junk
lfix
stjohns
template1

--
Oliver Elphick Oliver(dot)Elphick(at)lfix(dot)co(dot)uk
Isle of Wight http://www.lfix.co.uk/oliver
PGP: 1024R/32B8FAA1: 97 EA 1D 47 72 3F 28 47 6B 7E 39 CC 56 E4 C1 47
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839 932A 614D 4C34 3E1D 0C1C
========================================
"But I would not have you to be ignorant, brethren,
concerning them which are asleep, that ye sorrow not,
even as others which have no hope. For if we believe
that Jesus died and rose again, even so them also
which sleep in Jesus will God bring with him."
I Thessalonians 4:13,14

Browse pgsql-general by date

  From Date Subject
Next Message Andrew Snow 2001-08-20 10:04:57 RE: Finding database names for overnight vacuum
Previous Message Colin 't Hart 2001-08-20 09:56:32 Re: Finding database names for overnight vacuum