I followed the steps below.
- I installed PostgreSQL.
- I logged in as
postgres
via (sudo -i -u postgres
) - I created new user
new_user
via shell scriptcreateuser --interactive
- I granted that user permission to create databases.
- I created database:
createdb new_db
.
Now I want to give new_user
privileges be able to perform all default DML operations on tables created by himself (command bellow taken from this question), so I typed:
postgres=# ALTER DEFAULT PRIVILEGES FOR new_user IN SCHEMA
public GRANT SELECT, INSERT, UPDATE, DELETE ON TABLES TO new_user;
But got an error:
ERROR: syntax error at or near "new_user"
LINE 1: ALTER DEFAULT PRIVILEGES FOR new_user IN SCHEMA public GRANT...
I have no idea why this command is not working.