How to move from the Postgres user to another user in the PSQL shell?

0

I'm logged in by a console in a Postgresql database with the postgres user. I have another user in which I want to stop, but I can not find what command to execute by console to do this. How to move from one user to the other. Logged as posgres indicated: su - user2 and y does not change. I need the user to change from postgres = # to user2 = # in the console Of course I have user password 2.

    
asked by rendor9 29.09.2018 в 23:38
source

2 answers

1

That is not possible as far as I understand, you must log out and log back in with the other User

  

psql -U UserName -d DatabaseName

    
answered by 30.09.2018 / 01:17
source
0

Change user, you enter with the postgres users and then you execute the following command in the console changing the data by the yñde your interest.

psql -d database -U username -W

Greetings

    
answered by 30.09.2018 в 03:01