amprantino
amprantino

Reputation: 1687

Postgres UPDATE

I have been locked out of cacti after setting guest_user=admin :( So I am trying to recover my access

cacti=# select * from settings;
           name            | value
-------------------------------------------
 auth_method               | 1
 guest_user                | admin

When I try to run the query:

UPDATE settings SET guest_user = 'No User' WHERE guest_user = 'admin';

I get the error:

cacti=# UPDATE settings SET guest_user = 'No User' WHERE guest_user = 'admin';
ERROR:  column "guest_user" does not exist
LINE 1: UPDATE settings SET guest_user = 'No User' WHERE guest_user ...

Database is postgres and I am new to it. (its the first time I use it :-) )

Upvotes: 5

Views: 5375

Answers (1)

fvu
fvu

Reputation: 32953

Try

UPDATE settings SET value = 'No User' WHERE name = 'guest_user'; 

because the column names are name and value

Upvotes: 13

Related Questions