Specifying psql password on command line

From: "Tauren Mills" <tauren(at)servlets(dot)net>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Specifying psql password on command line
Date: 2001-06-06 00:59:28
Message-ID: NBBBLBKDJMGDNPMDGAABKEAGAEAB.tauren@servlets.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I've read the documentation for the psql commands as well as the createdb
and dropdb commands. It looks like there is no way to specify the password
on the command line. The password is always provided in the form of a stdin
prompt.

This makes it very difficult to use the commands from a shell script or a
cron job. The same with redirecting to/from a file or piping it
somewhere. It seems like there must be some way to specify the password on
the command line.

Am I missing something? Any workarounds?

Thanks,
Tauren

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tauren Mills 2001-06-06 01:11:56 RE: Limiting simultaneous connections
Previous Message Alex Pilosov 2001-06-06 00:23:49 Re: optimizer hints?