I was trying to reset the password.
r9mzsy20=# ALTER USER 9mz_dba WITH PASSWORD '92837474';
ERROR: syntax error at or near "9"
LINE 1: ALTER USER 9mz_dba WITH PASSWORD '92837474..
For user u_9mz_rw
and u_9mz_ro
I was able to reset the password.
ALTER USER u_9mz_ro PASSWORD '92837474' VALID UNTIL 'infinity';
ALTER USER u_9mz_rw PASSWORD '92837474' VALID UNTIL 'infinity';
But for this USER 9mz_dba
I am getting an error.
Can anyone please help with that.
Here is a list of my users:
2
Answers
Usernames which start with digits need to be quoted.
Try to add double quotes
"
around the user name:From the 4.1.1. Identifiers and Key Words:
Which means it’s perfectly fine to have a user/role identifier that doesn’t start with
a
–z
or underscore_
, but to reference it, you need to wrap it in double-quotes.Also, you lost the 3rd line of that error message with the caret
^
character, which should clarify it’s pointing at the first9
character, not the second one: demoIn PostgreSQL 15 and 16, the numeric literal processing was changed, which means the error message will change as well, trying and failing to interpret that as a number: demo