I'm connected to a Postgres 14 instance with postgres
role. I have created a new database called airflow
and a new user/role called airflow
too, who is the owner of the db.
List of databases
Name | Owner | Encoding | Collate | Ctype | Access privileges
-----------+-------------+----------+-------------+-------------+---------------------------------
airflow | airflow | UTF8 | en_HK.UTF-8 | en_HK.UTF-8 |
I have issued the command grant all on database airflow to airflow;
And then I have:
List of databases
Name | Owner | Encoding | Collate | Ctype | Access privileges
-----------+-------------+----------+-------------+-------------+---------------------------------
airflow | airflow | UTF8 | en_HK.UTF-8 | en_HK.UTF-8 | =Tc/airflow +
| | | | | airflow=CTc/airflow
However I still get this error:
sqlalchemy.exc.ProgrammingError: (psycopg2.errors.InsufficientPrivilege) permission denied for schema public
LINE 2: CREATE TABLE log (
^
[SQL:
CREATE TABLE log (
id SERIAL NOT NULL,
dttm TIMESTAMP WITH TIME ZONE,
dag_id VARCHAR(250),
task_id VARCHAR(250),
map_index INTEGER,
event VARCHAR(30),
execution_date TIMESTAMP WITH TIME ZONE,
owner VARCHAR(500),
extra TEXT,
CONSTRAINT log_pkey PRIMARY KEY (id)
)
]
(Background on this error at: https://sqlalche.me/e/14/f405)
I'm connecting to the instance as airflow
user to the airflow
database.
Update: Just saw on pgAdmin that I did not grant all on PUBLIC schema for airflow ...