question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can I use .pgpass authentication from command-line?

See original GitHub issue

System information:

  • Operating system (distribution) and version: MacOS 10.15.6
  • DBeaver version: 7.1.3.202007192031

Connection specification:

  • Database name and version: PostgresSQL 12.3

Describe your question:

I want to use DBeaver from the command-line, passing in all connection info as well as the username. However I don’t want to have the password on the CLI arguments list. I see DBeaver supports pgpass, but it doesn’t seem to be looking there for my CLI connection. I don’t see any mention of pgpass.

If I don’t specify the password, I get:

The server requested password-based authentication, but no password was provided.

I see the data-sources.json describes it as "auth-model": "postgres_pgpass", I tried passing in various versions of these strings but no dice. Is pgpass supported for CLI usage or am I missing something obvious?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:13 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
serge-ridercommented, Aug 20, 2020
0reactions
dtseilercommented, Aug 20, 2020

oh whew. That’s great!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Navigating Postgresql - Command Line Login / Using .pgpass
You can login to the database directly from a linux shell using psql. Typically, one would list the parameters used to connect directly...
Read more >
Postgresql: Scripting psql execution with password
Create the file using vim ~/.pgpass or similar. Input your information in the following format: hostname:port:database:username:password Do not add string ...
Read more >
How to use psql with no password prompt?
You have four choices regarding the password prompt: set the PGPASSWORD environment variable. For details see the manual:
Read more >
Documentation: 15: 34.16. The Password File - PostgreSQL
The file .pgpass in a user's home directory can contain passwords to be used if the connection requires a password (and no password...
Read more >
pgpass file does not set default username to connect as
psql defaults to using your current unix username when connecting, unless you specify something different. If you want a different default ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found