0

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?

0

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!).

  • I have a super user access but the standard super user for aurora have not been granted these permissions. Trying to limit the freedom to fuck up, such that when you want to change something like this you need to be able to grant yourself the permissions. – Peter Mølgaard Pallesen Aug 30 at 11:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.