Re: Finding database names for overnight vacuum - Mailing list pgsql-general

From Oliver Elphick
Subject Re: Finding database names for overnight vacuum
Date
Msg-id 200108200957.f7K9vcma005989@linda.lfix.co.uk
Whole thread Raw
In response to Finding database names for overnight vacuum  (Stephen Davies <scldad@sdc.com.au>)
List 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.Elphick@lfix.co.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



pgsql-general by date:

Previous
From: bpalmer
Date:
Subject: Re: Finding database names for overnight vacuum
Next
From: "Andrew Snow"
Date:
Subject: RE: Finding database names for overnight vacuum