Post

πŸ™οΈ Louisville Payroll Analytics – Part 2

⚑ PostgreSQL, DBeaver & Permission Hell

The second I tried to move from idea to implementation, reality hit: PostgreSQL permissions + DBeaver configuration process messier than expected!!! I thought I would β€œjust create a database and a table”, and I spent evenings staring at the following status instead:

1
2
ERROR: permission denied for schema public
ERROR: relation "salary_data" does not exist

Not exactly the fun, analytical work I had in mind, and that I thought this work was.


🧱 What Went Wrong

  • My PostgreSQL user didn’t have rights on the public schema.
  • DBeaver quietly kept failing to create tables until I read error messages.
  • I tried to import the CSV BEFORE the table existed, and of course it wasn;t working.

πŸ› οΈ Fixing the Environment

Once I slowed down and treated this like a real server, things clicked:

πŸ“ Step 1: Understanding how to connext postgres superuser πŸ“ Step 2: Grant proper privileges to my user πŸ“ Step 3: Reconnect to the database in DBeaver using the payroll_analyst user. πŸ“ Step 4: Run a first test

1
2
3
4
5
6
7
8
GRANT ALL PRIVILEGES ON DATABASE louisville_payroll TO payroll_analyst;
GRANT ALL PRIVILEGES ON SCHEMA public TO payroll_analyst;

...

CREATE TABLE test_table (id INT);
DROP TABLE test_table;

Seeing this statement run without errors: A MIRACLE!!!!


🎯 Next Steps

Prepare for analytical queries.

To be continued…

This post is licensed under CC BY 4.0 by the author.