I'm working on a script to convert json into database records and insert them into a local Postgres database.
Currently I have 2 scripts running. The first one writes records from json-file A into table A. The second one reads json-file B and inserts into table B. Table A and B are both located in the exact same database under the exact same schema (so schema1.A and schema1.B). I'm making the connection to the database in both scripts using identical credentials (IP / username / password/ database name). All the user rights are correctly handled as I can insert manually on either table using DBeaver logged in as said user.
When I run script 1, A gets read and records are written to table A. When I run script 2, B gets read but it errors out on writing to the table B.
The error is as follows:
2020/07/14 13:28:38 - Insert / update.0 - ERROR (version 8.3.0.0-371, build 8.3.0.0-371 from 2019-06-11 11.09.08 by buildguy) : Error in step, asking everyone to stop because of:
2020/07/14 13:28:38 - Insert / update.0 - ERROR (version 8.3.0.0-371, build 8.3.0.0-371 from 2019-06-11 11.09.08 by buildguy) : org.pentaho.di.core.exception.KettleDatabaseException:
2020/07/14 13:28:38 - Insert / update.0 - Error inserting/updating row
2020/07/14 13:28:38 - Insert / update.0 - ERROR: permission denied for schema schema1
It is boggling my mind. What can I do to fix this?
Alright. So I figured it out and the answer borders on ridiculous. It turns out it has nothing to do with access rights on any schema but rather with a field that was included in the field mapping but did not exist in the table .......
So much for helpful error messages.