Skip to main content

Change user type in the database

If Someone Is Found Who Did Not Keep the Main Admin as NORMAL

Written by Petr Pech

1) Navigate to the pgsql folder in the FB installation directory (you may first need to run "cd .." and then cd "PATH/PATH/..."), e.g. cd /"Program Files (x86)"/Winstrom/pgsql

2) Use the "dir" command to check which version of PostgreSQL is installed, then switch to the /bin folder of the corresponding version (e.g. cd 9.3/bin) / On Linux and macOS the directory is located elsewhere — see https://www.flexibee.eu/podpora/dokumentace/instalacni-prirucka/umisteni-adresaru/

3) Command: psql -U dba -p 5435 -h localhost -d centralServer -W
(-U user, -p port, -h host, -d server, -W require password / 7971)

4) select jmeno, user_type from csuzivatel;

5) begin; (starts a separate transaction — if a mistake is made, you can revert using rollback)

6) update csuzivatel set user_type = 'READ_ONLY' where jmeno = "XXX"; (changes user XXX to READ_ONLY)

7) update csuzivatel set user_type = 'NORMAL' where jmeno = "YYY"; (changes user YYY to NORMAL)

8) select jmeno, user_type from csuzivatel; (verify that everything is correct)

9) \q, or Control + D on Linux and macOS (closes the connection)

Did this answer your question?