Postgres Specific table access We have a requirement in our Postgres Database, We want to give specific table permissions to a particular set of user, we also have airflow in our environment which syncs tables, but sometimes any new columns are added to a table so we have to drop the table, due to which the specific table access for the user is gone. Access to a specific table is given through GRANT. Can you guys suggest us a way in which specific table access can be given, and will remain if the table is dropped and recreated?
As soon as a table is dropped, all grants are gone. There is no way to avoid that.
You should put all your grants into a SQL script, put that into your version control system (e.g. Git) and then run it after you applied all your migration scripts.
Schema migration tools like Liquibase, Flyway or Sqitch help you organize this.