Re: [GENERAL] Using psql on command line - Mailing list pgsql-general

From Eric Marsden
Subject Re: [GENERAL] Using psql on command line
Date
Msg-id m2ogsvap79.fsf@cook.onecert.fr
Whole thread Raw
In response to Using psql on command line  (Brian <signal@shreve.net>)
List pgsql-general
>>>>> "Brian" == Brian  <signal@shreve.net> writes:

  Brian> I would like to run a cron job nightly to vaccuum a few
  Brian> databases, but how do you execute from just a command line? I
  Brian> tried like:
  Brian>
  Brian> psql mydb < vacuum
  Brian> psql mydb | vacuum

One of

   ~$ echo "vacuum" | psql mydb
   ~$ psql mydb -c "vacuum"

Note that you'll have to be careful about the environment of the user
which is running the cron jobs (PGDATA etc).

--
Eric Marsden
emarsden @ mail.dotcom.fr
It's elephants all the way down

pgsql-general by date:

Previous
From: Brian
Date:
Subject: Using psql on command line
Next
From: Jeremiah Davis
Date:
Subject: Re: [GENERAL] Using psql on command line