今天下午 陷進去了 其實很簡單的一個事情結果浪費了 接近一個小時. 做事情必須要細致一些. 自己的確做的不好.
這里面簡單說一下pg_hba.conf 和 postgresql 密碼的一些設置問題.
1. windows 機器
安裝pg 時 有一個 讓輸入密碼的地址 這個 直接輸入密碼就可以了.
然后如果想修改密碼的話 可以在命令行里面處理.:

然后修改 data 目錄下面的 : pg_hba.conf

注意里面的配置文件內容:
The first field is the connection type: "local" is a Unix-domain socket, "host" is either a plain or SSL-encrypted TCP/IP socket, "hostssl" is an SSL-encrypted TCP/IP socket, and "hostnossl" is a plain TCP/IP socket. DATABASE can be "all", "sameuser", "samerole", "replication", a database name, or a comma-separated list thereof. The "all" keyword does not match "replication". Access to replication must be enabled in a separate record (see example below). USER can be "all", a user name, a group name prefixed with "+", or a comma-separated list thereof. In both the DATABASE and USER fields you can also write a file name prefixed with "@" to include names from a separate file. ADDRESS specifies the set of hosts the record matches. It can be a host name, or it is made up of an IP address and a CIDR mask that is an integer (between 0 and 32 (IPv4) or 128 (IPv6) inclusive) that specifies the number of significant bits in the mask. A host name that starts with a dot (.) matches a suffix of the actual host name. Alternatively, you can write an IP address and netmask in separate columns to specify the set of hosts. Instead of a CIDR-address, you can write "samehost" to match any of the server's own IP addresses, or "samenet" to match any address in any subnet that the server is directly connected to. METHOD can be "trust", "reject", "md5", "password", "scram-sha-256", "gss", "sspi", "ident", "peer", "pam", "ldap", "radius" or "cert". Note that "password" sends passwords in clear text; "md5" or "scram-sha-256" are preferred since they send encrypted passwords. OPTIONS are a set of options for the authentication in the format NAME=VALUE. The available options depend on the different authentication methods -- refer to the "Client Authentication" section in the documentation for a list of which options are available for which authentication methods. Database and user names containing spaces, commas, quotes and other special characters must be quoted. Quoting one of the keywords "all", "sameuser", "samerole" or "replication" makes the name lose its special character, and just match a database or username with that name. This file is read on server startup and when the server receives a SIGHUP signal. If you edit the file on a running system, you have to SIGHUP the server for the changes to take effect, run "pg_ctl reload", or execute "SELECT pg_reload_conf()". Put your actual configuration here
2. linux機器的話 也不復雜
而且 postgres 用戶的話 不需要輸入密碼就可以登錄了 能夠直接修改密碼...

其他配置文件都是一樣的.
