Skip to main content
Add context for source
Source Link
xlm
  • 7.7k
  • 15
  • 59
  • 60

I believe the best way to change the password is simply to use:

\password

in the Postgres console.

SourcePer ALTER USER documentation:

Caution must be exercised when specifying an unencrypted password with this command. The password will be transmitted to the server in cleartext, and it might also be logged in the client's command history or the server log. psql contains a command \password that can be used to change a role's password without exposing the cleartext password.

fromNote: https://www.postgresql.org/docs/9.0/static/sql-alterrole.html.ALTER USER is an alias for ALTER ROLE

I believe the best way to change the password is simply to use:

\password

in the Postgres console.

Source:

Caution must be exercised when specifying an unencrypted password with this command. The password will be transmitted to the server in cleartext, and it might also be logged in the client's command history or the server log. psql contains a command \password that can be used to change a role's password without exposing the cleartext password.

from https://www.postgresql.org/docs/9.0/static/sql-alterrole.html.

I believe the best way to change the password is simply to use:

\password

in the Postgres console.

Per ALTER USER documentation:

Caution must be exercised when specifying an unencrypted password with this command. The password will be transmitted to the server in cleartext, and it might also be logged in the client's command history or the server log. psql contains a command \password that can be used to change a role's password without exposing the cleartext password.

Note: ALTER USER is an alias for ALTER ROLE

Source Link
Viktor Nordling
  • 9.4k
  • 4
  • 29
  • 24

I believe the best way to change the password is simply to use:

\password

in the Postgres console.

Source:

Caution must be exercised when specifying an unencrypted password with this command. The password will be transmitted to the server in cleartext, and it might also be logged in the client's command history or the server log. psql contains a command \password that can be used to change a role's password without exposing the cleartext password.

from https://www.postgresql.org/docs/9.0/static/sql-alterrole.html.