Start a new topic

PostrgeSQL: pgpass file authentication

Hej

I would like to be able to authenticate to PostgreSQL using their .pgpass mechanism. I think along the lines DBeaver sports it - see attached screenshot.

Varma hälsningar

Thiemo

Hej Roger


I am afraid, there is more to say. I could test under Windwos and I could not make it work. First, I placed the .pgpass file into %APPDATA%\postgresql\pgpass.conf as the PostgreSQL documentation states to do and additionally into the user directory. In my opinion, the only adaquate place to put the file is the one PostgreSQL itself expects it in order to avoid maintenance of the file in different locations.


Please find the debug log attached and my below my applications properties.


Hälsningar


Thiemo



Product: DbVisualizer Pro 120.3119 [Build #3119] [BETA VERSION]
OS: Windows 10
OS Version: 10.0
OS Arch: amd64
Java Version: 11.0.7
Java VM: OpenJDK 64-Bit Server VM
Java Vendor: Azul Systems, Inc.
Java Home: c:\program files\zulu\zulu11
DbVis Home: C:\ProgramData\DbVisualizer_beta
User Home: C:\Users\Thiemo
PrefsDir: C:\Users\Thiemo\.dbvis
SessionId: 322
BindDir: \[3]
LI: Early Access [2021-01-07] ["BETA version"]
Java Arguments: <none>
Java Properties:
--add-exports=java.base/sun.security.action=ALL-UNNAMED
--add-exports=java.desktop/sun.awt.shell=ALL-UNNAMED
--add-exports=java.desktop/sun.swing.plaf.synth=ALL-UNNAMED
--add-exports=java.desktop/sun.swing.table=ALL-UNNAMED
--add-exports=java.desktop/sun.swing=ALL-UNNAMED
--add-exports=java.xml/com.sun.org.apache.xerces.internal.parsers=ALL-UNNAMED
--add-opens=java.base/java.util=ALL-UNNAMED
--add-opens=java.desktop/com.sun.awt=ALL-UNNAMED
--add-opens=java.desktop/java.awt.event=ALL-UNNAMED
--add-opens=java.desktop/javax.swing.plaf.basic=ALL-UNNAMED
--add-opens=java.desktop/javax.swing.plaf.synth=ALL-UNNAMED
--add-opens=java.desktop/javax.swing.text.html=ALL-UNNAMED
--add-opens=java.desktop/javax.swing.tree=ALL-UNNAMED
--add-opens=java.desktop/javax.swing=ALL-UNNAMED
--add-opens=java.desktop/sun.awt.image=ALL-UNNAMED
--add-opens=java.desktop/sun.awt=ALL-UNNAMED
--add-opens=java.xml/com.sun.org.apache.xerces.internal.util=ALL-UNNAMED
-Ddbvis.home=C:\ProgramData\DbVisualizer_beta\
-Dexe4j.consoleCodepage=cp0
-Dexe4j.isInstall4j=true
-Dexe4j.moduleName=C:\ProgramData\DbVisualizer_beta\dbvis.exe
-Dexe4j.semaphoreName=Local\c:_programdata_dbvisualizer_beta_dbvis.exe
-Dexe4j.tempDir=
-Dexe4j.unextractedPosition=0
-Dinstall4j.launcherId=2
-Dinstall4j.swt=false
-Djava.library.path=c:\program files\zulu\zulu11\bin;C:\ProgramData\DbVisualizer_beta\.\jdbc\jtds\x64\SSO;C:\Program Files\Zulu\zulu11\bin;C:\ProgramData\ffmpeg\bin\;C:\ProgramData\Python\Python39\Scripts\;C:\ProgramData\Python\Python39\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\TortoiseSVN\bin;C:\Program Files (x86)\Gpg4win\..\GnuPG\bin;C:\Program Files\Zulu\zulu8\bin;C:\Program Files\jEdit;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\PuTTY\;C:\Users\Thiemo\AppData\Local\Microsoft\WindowsApps;
-Dsun.locale.formatasdefault=true
-XX:StringTableSize=1000003
-Xmx768m
Theme: FlatLightLaf
Keymap: Default (is System keymap)
Screen 1: size: 2560 x 1440, refresh rate: 59, bit depth: 32, scale: 100% (default screen)
Monitor Running: No

*** JVM Options (Application) **********************
-Xmx768m
-XX:StringTableSize=1000003
-Dsun.locale.formatasdefault=true
-include-options ${USERPROFILE}\.dbvis\user.vmoptions



*** Database Properties ****************************
Alias: postgres@localhost
Notes: [0 characters]
Settings Format: Server Info
URL: jdbc:postgresql://localhost:5432/postgres
Driver: PostgreSQL
Userid: postgres
Preferred Database Type: AUTO
Current Database Type: POSTGRESQL
Preferred Profile: auto
Current Profile: null (not connected?)
Connection State(s): DISCONNECTED, ERROR
--- Object Type Settings ---------------------------
None
--- Overridden User Properties ---------------------
postgresql.AuthenticationSource = PGPASS
postgresql.AutoCommit = false
--- Overridden Driver Properties -------------------
ApplicationName = dbvis
loggerLevel = OFF
*** End Database Properties ************************
*** Driver Information *****************************
Name: PostgreSQL
DefaultDriver: true
DefaultClass: org.postgresql.Driver
Paths:
  Path: C:\ProgramData\DbVisualizer_beta\jdbc\postgresql\postgresql.jar
    Class: org.postgresql.Driver
*** End Driver Information *************************
*** Current Connection Message *********************
An error occurred while establishing the connection:
The pgpass-file is either missing or not readable by the user.
Please verify that the pgpass-file exists and that user has read-rights on the file.
*** End Current Connection Message *****************


0
(41.2 KB)

Hej Roger


I have come to test it only now and only under Linux. It just works. :-) What is there more to say? Perfect! Many thanks.


Varma hälsningar


Thiemo

Hej Thiemo,


We've started the beta testing of the next feature version and it comes with support for .pgpass.


https://www.dbvis.com/beta/


Give it a try and let us know what you think.


Regards


Roger

Thiemo,


Thanks for the suggestion. I'll open a ticket for it.


Regards


Roger

Login or Signup to post a comment