Reputation: 183
I would like to create a user who can access the DB from any IP I am currently creating users as follows.
CREATE USER Tony@'1.2.3.4' IDENTIFIED BY 'password';
Is there some way to alter this to create such a user?
Upvotes: 1
Views: 6232
Reputation:
A user in Postgres is independent of the IP address from where the connect is made.
Access restrictions per IP address are defined in an earlier step through the network configuration defined in pg_hba.conf
So if you don't have any restrictions in pg_hba.conf
then creating a user, using:
create user tony with password 'password';
will allow a login from everywhere (again: if pg_hba.conf
is configured correctly).
For details on how to configure pg_hba.conf
please see the manual:
http://www.postgresql.org/docs/current/static/client-authentication.html
Upvotes: 4
Reputation: 3
You may use "*" for host as in :
CREATE USER Tony@* IDENTIFIED BY 'password';
Upvotes: -5