※事前にしておくこと
PostgreSQLのODBCドライバのダウンロードとインストール
VBAの参照設定でMicrosoft ActiveX Data Objects 2.x Library の参照
ソース例
Dim con As New ADODB.Connection
    
con.ConnectionString = "Provider=MSDASQL;" & _
                           " DSN=PostgreSQL35W;" & _
                           " DATABASE=c0common;" & _
                           " SERVER=localhost;" & _
                           " PORT=5432;" & _
                           " UID=postgres;" & _
                           " PWD=postgres;" & _
                           " SSLmode=disable;"
con.Open
'SQLでデータ取得
Dim sql As String
sql = "SELECT * FROM t_account"
     
'レコードセット取得
Dim rst As ADODB.Recordset
Set rst = con.Execute(sql)
     
'Excelシート上にレコードセットを展開
Sheets.Add , ActiveSheet
For i = 1 To rst.Fields.Count    'フィールド名を取り込む
  Cells(1, i).Value = rst.Fields(i - 1).Name
Next
Range("A2").CopyFromRecordset rst, 65535    '(貼り付け最大行数)
'後処理
Set rst = Nothing
con.Close
Set con = Nothing