Postgresql – How to alter system on AWS RDS

amazon-rdsawspostgresql

I need to run

ALTER SYSTEM SET track_activity_query_size = 16384;

So I can see the contents of some long running queries (I can only see the beginning at the default size), but when I try to do that in pgAdmin on my RDS instance I get the error

ERROR:  must be superuser to execute ALTER SYSTEM command

How do I run that alter system query?

Best Answer

The RDS Postgres instance has a parameter group. Check in RDS colsole what parameter group is defined: RDS -> Databases -> choose your db -> Configuration -> parameter group. If it's the default one, create a new one and change track_activity_query_size to the value you need. Apply the new parameter group or change the actual one. The parameter is static so a restart is needed in any case.

Check this link for more details, please: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_WorkingWithParamGroups.html