In the process of migration from local postgres version to and RDS aurora postgres version. I'm using temporal tables and do for that reason have temporal tables that are inhirited from the origin. For example students
and student_history
, where the history table store the historical stages of the students.
When deleting a column in students, the corresponding column does not delete in students_history.
Which c
I clever college of mine(who found a better job) found a solution of changing the 'pg_attribute.attislocal'(see script below) for the table which solved the problem.
UPDATE pg_attribute
SET attislocal=false
WHERE attrelid = '{parent_table_name}_history'::regclass
AND NOT attisdropped
AND attnum > 0
AND attinhcount > 0;
So I run the script user the super user account I get:
permission denied for relation pg_attribute
So how do I grant he super user permissions to change the pg_attribute
or is there anything else I'm overlooking?
Best Answer
Only a superuser can do that, and you probably won't get a superuser in a hosted database.
You will have to drop the history tables and re-create them new as inheritance children (without specifying the duplicate columns!).