"ROLE" is not valid at this position, expecting - mysql-workbench

I am trying to create roles in mysql workbench, but I keep getting an error saying "create role" is not the right syntax. What am I doing wrong?

Related

Postgres error message (in pgAdmin): "database 'postgres' does not exist", after 'postgres' table droped

In order to organize my local database server, I've executed DROP DATABASE postgres;. After it when I try to connect to database, it shows an error message:
database "postgres" does not exist
I've restarted the service; I've tried to reinstall postgres (install file:'postgresql-12.11-1-windows-x64'); I've tried to change the 'method' of file 'pg_hba.conf', from 'md5' to 'trust'. But the error continues.
Please, how can I create this 'postgres' database? Or other solution?
I've created a new server and then a new database. When I was recreating a database, I identified that the database 'postgres' is automacally created, and to create a my database is necessary set a owner, and by default the owner is 'postgres'.
Note: Maybe this suggestion (How to recover or recreate orginal Postgres database after dropping it?) could be work, when I saw this reply I'd already soluted how I described above.

PostgreSQL - Role "pg_read_all_data" not working as intended?

According to my understanding of the PostgreSQL documentation, the role "pg_read_all_data" should grant the role holder the ability to execute "Select * from SCHEMA.TABLE" and similar to view the data. However, I'm unsure why this is not working out in practice for me.
I have created a sample schema and database on account "X" for example:
Image showing schema and table structure
However, when I log into role "Y" (with log in option enabled) with the role "pg_read_all_data" and try to execute:
SELECT * FROM test.test_table
Edit: I have assigned the role "pg_read_all_data" via the command: GRANT pg_read_all_data to "Y" on a superuser role.
It throws a permission error: SQL Error [42501]: ERROR: permission denied for schema test
Position: 15
I'm a little lost on why this is the case when the role should've granted select privileges. Can someone tell me why this is happening?
Closed - After a few days away, I went back to the issue and it seemed to have resolved itself.

PSQL login - error: FATAL: role "User" does not exist

Windows 10 user trying to either delete a role permanently so the error doesn't show up or create a superuser with no password.
Been searching for hours to no avail. Tried:
Creating a new user and database with
CREATE USER Nistic SUPERUSER;
CREATE DATABASE registration WITH OWNER Nistic;
The role was successfully created, but upon logging out, and back in, typing "psql" into the terminal will still bring up the same error. [EDIT] I can login with the postgres username by typing psql -U postgres, but for whatever reason the default username is still set to Nistic.
I've already checked the conf file and set all the methods to trust. I tried dropping the user and recreating the user.
I just wanted the title to include User to be more general, despite showing Nistic above.
I've pretty much tried everything else that I could find on SO.
Please help, thank you.
Screen below to show some of the oddness (please read each line before commenting - the issue is that after getting rid of Nistic, it still expects Nistic)

Adempiere - Table not found AD_System

This question is for those who have experience with Adempiere ERP.
when logging in, I get the error table ad_system is not found. connecting to Postgresql I can see the database along with the table name. not sure why it says so. anyone else experienced the same issue?
my Postgres user does have superuser permissions
[error message on login]
Try to query the database to see if it has data or if it's empty, for example:
SELECT * FROM AD_System
or
SELECT * FROM C_BPartner
That error usually appears when you do a bad DB restoration and the DB Tables are empty.

Can postgres role name be `user`?

My username in the personal laptop is user. So running psql from command line throws an error psql: FATAL: role "user" does not exist. This is because the user is a reserved keyword(not sure about the right term) in postgres. Is there a workaround for this problem?
Trying to create a role user errors out for the same reason.
postgres=# CREATE USER user;
ERROR: syntax error at or near "user"
LINE 1: CREATE USER user;
^
You need to quote reserved words. Try CREATE USER "user"