This error occurs in AWS RDS when attempting to modify parameters in a default parameter group, which is immutable. AWS restricts changes to default groups for safety. Create a custom parameter group instead and apply it to your RDS instance to resolve this issue.
When using AWS RDS for PostgreSQL, the system provides default parameter groups that are managed by AWS and cannot be modified. These defaults are intentionally locked to prevent accidental misconfiguration that could affect database stability or security. When you attempt to change any parameter value in a default parameter group (such as shared_preload_libraries, max_connections, or work_mem), AWS RDS rejects the modification with an InvalidParameterValue error. This is a safety mechanism: default parameter groups serve as read-only references. Custom parameter groups, on the other hand, are fully editable and can be associated with your RDS instances. RDS allows multiple parameter groups per instance and supports changing which group is active.
Navigate to the RDS dashboard and create a new parameter group based on your PostgreSQL version.
1. Go to Parameter groups in the AWS RDS console
2. Click Create parameter group
3. Select your PostgreSQL version (e.g., postgres15) from the Parameter group family dropdown
4. Give it a descriptive name like postgres15-custom-params
5. Add an optional description
6. Click Create
Alternatively, using the AWS CLI:
aws rds create-db-parameter-group \
--db-parameter-group-name postgres15-custom-params \
--db-parameter-group-family postgres15 \
--description "Custom parameter group for PostgreSQL 15"Now that you have a custom parameter group, you can modify its parameters.
1. Go to Parameter groups and click your custom group name
2. Click Edit or Modify
3. Search for and modify the parameter you need (e.g., shared_preload_libraries)
4. For shared_preload_libraries, enter: pg_stat_statements
5. Click Save changes
Using the AWS CLI:
aws rds modify-db-parameter-group \
--db-parameter-group-name postgres15-custom-params \
--parameters "ParameterName=shared_preload_libraries,ParameterValue=pg_stat_statements,ApplyMethod=pending-reboot" \
--region us-east-1Next, apply the custom parameter group to your RDS database instance.
1. Go to Databases in the RDS console
2. Click on your PostgreSQL instance
3. Click Modify
4. Under DB parameter group, select your custom parameter group (e.g., postgres15-custom-params)
5. Under Scheduling of modifications, choose Apply immediately or Apply during maintenance window
6. Click Continue and then Modify DB instance
Using the AWS CLI:
aws rds modify-db-instance \
--db-instance-identifier my-postgres-instance \
--db-parameter-group-name postgres15-custom-params \
--apply-immediately \
--region us-east-1Some parameters are dynamic and apply immediately, while others are static and require a reboot.
Check the parameter's Apply type in the parameter group details:
- Dynamic: Changes apply immediately, no reboot needed
- Static: Changes apply after reboot
If you modified a static parameter, reboot the instance:
1. Go to Databases and select your instance
2. Click Reboot
3. Choose Reboot with failover (if using Multi-AZ for zero downtime) or Reboot (standalone)
4. Confirm the reboot
Using the AWS CLI:
aws rds reboot-db-instance \
--db-instance-identifier my-postgres-instance \
--region us-east-1Wait for the instance status to change from "rebooting" to "available".
After the instance is available (and rebooted if necessary), verify the parameter was applied:
1. Connect to your PostgreSQL database using psql:
psql -h <rds-endpoint> -U postgres -d postgres2. Check the parameter value:
SHOW shared_preload_libraries;
-- Should output: pg_stat_statements3. In the RDS console, check the instance details under Parameter groups—status should show "in sync" (not "pending reboot").
If it shows "pending reboot", another parameter reboot is needed or the previous reboot did not complete successfully.
Custom Parameter Groups vs. Defaults: Every RDS instance must use a parameter group, either default or custom. You can only have one parameter group active per instance at a time, but you can switch between multiple custom parameter groups at any point. When you create a custom group from a default, it inherits the default values but becomes fully editable.
Dynamic vs. Static Parameters: PostgreSQL distinguishes between parameters that require a server restart and those that don't. RDS respects this distinction—if you modify a static parameter (marked "Apply type: static"), AWS shows the status as "pending reboot" until you manually reboot. For dynamic parameters, changes apply immediately even without setting apply_immediately.
Terraform and IaC: If using Terraform, ensure your aws_db_parameter_group resource has create_before_destroy = true to prevent deletion races when switching groups. Also verify that you're targeting a custom group, not a default.
Parameter Group Families: Parameter group families are tied to PostgreSQL major versions (postgres13, postgres14, postgres15, etc.). You cannot apply a postgres14 parameter group to a postgres15 instance. When upgrading your RDS instance, you must also create or select a parameter group matching the target version.
ERROR: syntax error at end of input
Syntax error at end of input in PostgreSQL
Bind message supplies N parameters but prepared statement requires M
Bind message supplies N parameters but prepared statement requires M in PostgreSQL
Multidimensional arrays must have sub-arrays with matching dimensions
Multidimensional arrays must have sub-arrays with matching dimensions
ERROR: value too long for type character varying
Value too long for type character varying
insufficient columns in unique constraint for partition key
How to fix "insufficient columns in unique constraint for partition key" in PostgreSQL