Amazon Aurora Postgresql
AWSOfficialPublished by AWS
- Skill
- Tool integration
- Cloud and DevOps
- Apache-2.0
- Low risk
- Has scripts
AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
Amazon Aurora PostgreSQL provides a structured approach to managing Aurora PostgreSQL clusters, offering sub-skills for cluster creation, serverless capacity planning, storage optimization, commitment-based cost analysis, and version upgrade planning. It includes safety guardrails for resource mutations and utilizes specific scripts for sizing and financial modeling. The skill is designed to route user requests to the appropriate domain-specific instructions while ensuring consistent resource tagging and adherence to AWS operational best practices.
What it does
- Provisions Aurora PostgreSQL clusters using either express or full configuration workflows.
- Analyzes Aurora serverless capacity requirements and ACU sizing.
- Evaluates the cost-benefit of switching to I/O-Optimized storage.
- Compares Reserved Instances and Database Savings Plans for cost optimization.
- Provides guidance and checklists for major and minor version upgrades.
- Applies mandatory resource tagging and safety guardrails for all cluster operations.
When to use it
- When you need to create or modify an Aurora PostgreSQL cluster.
- When planning capacity for Aurora serverless or evaluating ACU scaling.
- When assessing whether to switch to I/O-Optimized storage.
- When comparing Reserved Instances versus Database Savings Plans.
- When preparing for a major or minor PostgreSQL version upgrade.
Advantages
- Automates complex configuration decisions through a structured decision matrix.
- Provides consistent, script-based financial analysis for cost optimization.
- Enforces safety guardrails to prevent accidental production impact.
- Ensures standardized resource tagging for all created infrastructure.
- Simplifies connection management for express-configured clusters via IAM auth.
Usage examples
- “I need to set up a new Aurora PostgreSQL database.”
- The agent identifies the request as a cluster creation task, determines whether to use express or full configuration based on your requirements, and guides you through the provisioning process.
- “Should I switch my cluster to I/O-Optimized storage?”
- The agent evaluates your current I/O usage against the 25% cost threshold rule and provides a recommendation on whether the switch is cost-effective.
- “Help me compare Reserved Instances and Savings Plans for my cluster.”
- The agent runs a commitment pricing analysis to show potential savings over 1-year or 3-year terms based on your specific instance type and region.
- “How do I plan for a major version upgrade of my Aurora PostgreSQL cluster?”
- The agent provides a pre-upgrade checklist, recommends a target version, and suggests a blue/green deployment strategy.
Install
Download the skill as a ZIP:
https://autogineer.com/agent-skills/aws/amazon-aurora-postgresql/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip amazon-aurora-postgresql.zip -d .agents/skills
Documentation by AWS
Amazon Aurora PostgreSQL
A modular toolkit for Aurora PostgreSQL organized as a registry of sub-skills. Each sub-skill handles one domain of Aurora PostgreSQL work. The router matches user intent to the right sub-skill, then loads only the references needed. (For Aurora MySQL, use the amazon-aurora-mysql skill.)
Operating procedure (follow in order)
Route — match the request to a sub-skill using the Trigger phrases column (match on meaning, not exact wording), then confirm with the When to route here column.
Load —
file_readthe matched sub-skill'sreferences/{id}-instructions.mdand announce the path. Do not answer a matched sub-skill from general knowledge alone.Analyze / advise — perform the sub-skill's work; run a bundled script when the user supplies the inputs (see Scripts).
If a mutation is requested — classify against the Safety guardrails tier, confirm with the user, apply resource tags, then execute (MCP-preferred, CLI fallback).
Present results — tables with dollar/ACU figures and a recommendation label; no derivation or arithmetic steps.
Edge cases: if the request spans multiple sub-skills, run them in sequence (load each instructions.md in turn). If no sub-skill matches, answer directly from Aurora PostgreSQL knowledge. If a script or MCP/CLI call fails, show the error and suggest a fix before retrying. The numbered Global rules below are details that hang off these steps.
Sub-skill registry
Column semantics: Trigger phrases = the keyword index you match the request against (step 1). When to route here = the decision logic confirming the match. Next steps = sub-skills to offer the user as a natural follow-up after this one completes (not auto-chained); Reached from = sub-skills that typically route into this one. Next-steps/Reached-from are suggestions for guiding the user, never automatic execution.
| ID | Name | When to route here | Trigger phrases | Reached from | Next steps |
|---|---|---|---|---|---|
create | Create Cluster | Routes Aurora PostgreSQL cluster creation requests. Express configuration (single API call, no VPC) is the default — routes to express-create. Routes to full configuration when VPC, custom KMS, custom params, or a specific engine version is required. | create a cluster, new database, set up Aurora PostgreSQL, get started, need a PostgreSQL database, provision | — | express-create, serverless-advisory, io-optimized |
express-create | Express Configuration | Provisions Aurora PostgreSQL serverless via the single-API-call express flow. AWS-managed connectivity (no customer VPC). IAM-only authentication via Internet Access Gateway — no master password. Post-creation connection is via IAM auth token (aws rds generate-db-auth-token). Use when no VPC, custom KMS, or custom parameter group is required. Routes back to create for full configuration needs. | express configuration, express create, internet access gateway, single API call, Aurora PostgreSQL serverless quick start, no VPC, IAM auth token, how to connect to express cluster | create | — |
serverless-advisory | Aurora serverless Advisory | All Aurora serverless questions: ACU sizing, scale-to-zero behavior and compatibility, provisioned→serverless migration, capacity planning, and feature constraints. | ACU sizing, Aurora serverless, scale-to-zero, provisioned to serverless, how many ACUs, capacity, auto-scaling, RDS Proxy compatibility, scale-to-zero incompatibility, serverless limitations | create (optional) | commitment-pricing |
io-optimized | I/O-Optimized Storage | Evaluates whether to switch from Aurora Standard to I/O-Optimized (aurora-iopt1). Uses the 25% I/O cost threshold rule. | I/O-Optimized, aurora-iopt1, storage type switch, 25% threshold, I/O costs too high, storage comparison | — | — |
commitment-pricing | Commitment Pricing | Compares Reserved Instances vs Database Savings Plans for provisioned clusters, and DSP-only for Aurora serverless. 1yr vs 3yr analysis. | Reserved Instance, RI, Savings Plan, DSP, 1yr vs 3yr, commitment, cost optimization, overpaying | serverless-advisory (optional) | — |
upgrade-planning | Upgrade Planning | Major and minor version upgrade planning for Aurora PostgreSQL. LTS version guidance, pre/post-upgrade checklists, blue/green deployment recommendations. | upgrade, version, LTS, pre-upgrade checklist, post-upgrade, major version, minor version, end of life, deprecation | — | — |
Express vs Full configuration — decision matrix
When routing a create request (sub-skill create), pick the path with this matrix. Express is the default for Aurora PostgreSQL; route to Full configuration only if ANY "Full" trigger is present. Don't present the choice to the user — decide, then state which path and why.
| Requirement / signal | Express | Full config |
|---|---|---|
| Default PostgreSQL create, no special networking | ✅ default | — |
| Quick start / "no VPC setup" / "ready in seconds" | ✅ | — |
| Customer VPC, subnet group, or specific security group | — | ✅ required |
| Customer-managed KMS key (CMK) | — | ✅ required |
| Custom DB cluster parameter group at creation | — | ✅ required |
| Specific engine version pinned by the user | — | ✅ required (intent to pin = not express) |
| Aurora MySQL | n/a | use amazon-aurora-mysql (express is PG-only) |
Notes: any single Full trigger disqualifies express — name every trigger you matched in the routing statement. Express clusters are still customizable after creation (e.g. a custom parameter group can be applied post-create), so a future need isn't itself a reason to start with Full. Full depth on the flow lives in references/express-create-instructions.md and references/create-instructions.md — load those for the actual steps.
Global rules (apply to every sub-skill)
Execute, don't just suggest. When the user requests an action and confirms, EXECUTE it rather than handing back a command to run. The AWS MCP server is the recommended execution path when available (sandboxed, IAM-authenticated, audit-logged) — prefer it. When MCP tools are not available (e.g. Claude Code, Cursor, or other non-MCP hosts), use the AWS CLI / SDK directly with the same
aws rds ...operation. Only if execution is genuinely not possible in the current environment, present the complete CLI command for the user to run.Confirmation before mutation. MUST confirm with the user before any create or modify operation. Do NOT execute without explicit confirmation ("yes", "proceed", "confirmed", "go ahead").
Resource tagging (always apply on resource creation). When creating any cluster or instance, ALWAYS include these tags:
--tags Key=created_by,Value=aurora-skill Key=generation_model,Value={your-model-id}Use your model id if known; if you cannot reliably determine it, useValue=unknown— never let tagging block the create. Include these tags even if the user does not mention tagging. If the user provides additional tags, append these to their tags.Safety guardrails.
Tier 1 — Confirm (a yes/no confirmation is enough; no risk briefing required):
create-db-cluster,create-db-cluster --with-express-configurationcreate-db-instancemodify-db-cluster --serverless-v2-scaling-configuration(ACU scaling)modify-db-cluster --backup-retention-periodmodify-db-cluster --deletion-protection/--no-deletion-protectionmodify-db-cluster --enable-cloudwatch-logs-exportsmodify-db-cluster --preferred-backup-windowmodify-db-cluster --enable-http-endpoint(Data API)add-tags-to-resource,remove-tags-from-resource
Tier 2 — High-impact: state the specific risk, THEN confirm (spell out the impact before asking; do not call any API until the user confirms with that risk in front of them):
modify-db-cluster --storage-type— no downtime for most instance classes; requires restart for NVMe/Optimized Reads instances (r6gd, r6id, r8gd). Switching from Aurora Standard to Aurora I/O-Optimized is limited to once every 30 days; switching from Aurora I/O-Optimized back to Aurora Standard can be done at any time.modify-db-instance --db-instance-class— causes failover in multi-AZmodify-db-cluster --engine-versionfor a minor version upgrade — applied in the maintenance window (or immediately with--apply-immediately); brief failover/restart. State the target version and the restart impact, then confirm. (For a major version upgrade, see Block below — route toupgrade-planningfirst.)Any modify with
--apply-immediately— bypasses maintenance window
Tier 3 — Block (refuse, explain why, redirect to console/change-control):
delete-db-cluster,delete-db-instance— irreversiblefailover-db-cluster,switchover-blue-green-deployment— production impactmodify-db-cluster --engine-versionacross major versions — requires prechecks and rollback planmodify-db-cluster --master-user-password,--manage-master-user-password— credential management must be performed by the customer directly. Express clusters use IAM-only auth via the Internet Access Gateway and have no master password — these flags do not apply on express clusters and must NOT be used as a workaround for connection issues. For full-config clusters, use AWS Secrets Manager rotation or the AWS Console.modify-db-cluster --vpc-security-group-ids— network security posture changemodify-db-cluster --db-cluster-parameter-group-name— can break applicationscreate-db-instance --publicly-accessible,modify-db-instance --publicly-accessible— NEVER make Aurora instances publicly accessible. This exposes the database directly to the internet and is never the correct solution for connectivity. See secure connection alternatives below.purchase-reserved-db-instances-offering,create-savings-plan— financial commitmentreboot-db-instance,reboot-db-cluster— production impact
When blocking, you MUST refuse immediately. Do NOT call any AWS API. Your response MUST have exactly two paragraphs:
Paragraph 1 — refuse: "I can't perform [action] because [reason]. This should go through your team's change-control process or the AWS Console."
Paragraph 2 — alternative (from the table below, always included):
purchase-reserved-db-instances-offering,create-savings-plan→ "I can run a commitment pricing assessment (RI vs DSP comparison) so you have the numbers to bring to procurement."delete-db-cluster,delete-db-instance→ "I can help with snapshot creation or final-snapshot validation before deletion."modify-db-cluster --engine-version(major version) → "I can run an upgrade assessment — target version recommendation, prechecks, and pre/post checklists."failover-db-cluster,switchover-blue-green-deployment→ "I can validate the cluster's state and review the failover/switchover plan with you."reboot-db-instance,reboot-db-cluster→ "I can check for pending modifications and recommend a maintenance window."modify-db-cluster --master-user-password/--manage-master-user-password→ "If this is an express cluster, there's no master password — express uses IAM-only auth via the Internet Access Gateway. I can walk you through generating an IAM auth token to connect. If this is a full-config cluster, rotate the password via AWS Secrets Manager or the AWS Console; both are safer than a direct API call."--publicly-accessible→ "Making the instance publicly accessible exposes the database directly to the internet — this is a security anti-pattern even for prototypes. Instead: (1) Use express configuration — internet-accessible via IAM auth with no VPC; (2) Enable RDS Data API — query over HTTPS with IAM auth; (3) EC2 bastion with SSH tunnel. I can help you set up any of these."modify-db-cluster --vpc-security-group-ids→ "I can describe the cluster's current security-group configuration and help you draft the intended change so you can apply it through your team's change-control process or the AWS Console."modify-db-cluster --db-cluster-parameter-group-name→ "I can review the current parameter group and compare it against the target group (highlighting reboot-required parameters) so you can prepare the change for your team's change-control process or the AWS Console."
Never omit paragraph 2. A refusal without an alternative is incomplete.
Reference loading. Before responding to any matched sub-skill request, you MUST read
references/{id}-instructions.mdusing your file-read tool (file_readif available, otherwise whatever your runtime exposes). Do not answer a matched sub-skill from the registry summary alone. Announce the path in your reply.Express is a single CLI call. When using express configuration:
create-db-cluster --with-express-configuration. Do NOT separately specify--engine-mode,--serverless-v2-scaling-configuration,--master-username, or--manage-master-user-password. The express flag sets all of these automatically.Stay in scope. Once this skill is active, recommend the best Aurora configuration for the workload. Do not suggest non-AWS alternatives. For light workloads, recommend express with scale-to-zero.
Never fabricate. Do NOT invent AWS API results, pricing numbers, version lists, or instance metadata. If a live call fails, report the blocker and offer offline mode with user-supplied numbers.
Carry context forward. Pass along cluster ID, region, and workload details the user already supplied. They SHOULD NOT have to re-type information already in the conversation.
Broad requests. If the user says "help me with Aurora" or "analyze my cluster" without specifying a domain (create, sizing, I/O, commitment, upgrade), present the sub-skill domains as one line each and ask which they want to focus on. Do NOT silently pick a sub-skill and run it. Acknowledge any cluster ID and region so the user doesn't need to repeat them.
Out-of-scope topics. If the user asks about an Aurora feature not covered by a sub-skill (e.g., Global Database, Blue/Green Deployments, RDS Proxy), note that it is not covered by a specific sub-skill, answer from general Aurora knowledge, and link to the relevant AWS documentation page.
Credential safety. Do not create, store, or display long-lived credentials or DB passwords. However,
aws rds generate-db-auth-tokenis approved — it produces a short-lived (15-minute) IAM token. This is the required connection method for express clusters. For non-express clusters, use user-supplied secret ARNs or pre-configured tunnels.Present results clearly. Use tables with dollar figures, ACU numbers, and recommendation labels. Do NOT show derivation or arithmetic steps. Exception: when consolidating across multiple analyses ("summarize", "what should I do"), respond in 2-4 lines of plain prose — no headers, no bullets, no tables.
Scripts
Bundled scripts in scripts/ for offline analysis. MUST use these when the user provides the required inputs — do NOT hand-calculate. Each script documents its full flags/usage in its own --help and header docstring; read those on demand rather than relying only on the one-line usage below.
Script execution model: If a shell is available, execute the script directly and present the output. If no shell is available, print the exact command as a fenced bash code block with all flags resolved to user-supplied values, then present results computed inline from the reference file's pricing tables. (Result-presentation format is governed by the Operating procedure / Global rules — no derivation steps.)
| Script | Purpose | Usage |
|---|---|---|
acu_calculator.py | Aurora serverless ACU sizing | python3 scripts/acu_calculator.py estimate --instance <type> --cpu-p95 <val> --cpu-max <val> --storage <val> |
io_optimized_analyzer.py | I/O-Optimized breakeven | python3 scripts/io_optimized_analyzer.py offline --instance <type> --num-instances <n> --storage-gib <val> --monthly-io-millions <val> |
commitment_pricing_analyzer.py | RI vs DSP cost comparison | python3 scripts/commitment_pricing_analyzer.py offline --instance <type> --num-instances <n> --region <region> (provisioned) or --serverless --avg-acu <val> (Aurora serverless) |
Troubleshooting
AccessDenied: Attach
AmazonRDSReadOnlyAccess+CloudWatchReadOnlyAccessfor reads. For creates/modifies, use a custom policy scoped tords:CreateDBCluster,rds:CreateDBInstance,rds:ModifyDBCluster,rds:ModifyDBInstance,rds:AddTagsToResource, andrds:Describe*. See Identity and access management for Amazon Aurora.ExpiredToken / credentials: Refresh your AWS credentials using whatever mechanism you use (e.g. re-run your SSO/
aws sso login,ada credentials update, assume-role, or refresh the profile), then retry. Do not assume a specific credential tool.DBClusterNotFoundFault: Verify region and cluster ID.
Throttling: Retry once, then narrow scope.
Additional Resources
Handoff from aws-database-selection
This skill can be entered from aws-database-selection after it produces a requirements.json. When you see a path matching aws_dbs_requirements/*/requirements.json in conversation:
Read the artifact. Sanity-check it has the fields you'll use — at minimum
engine(or workload type),region, and the workload signals you route on (capacity/ACU hints, storage size, connectivity/VPC needs, version). If those are present and parseable, use them; if it's missing them or won't parse, proceed without it (don't block on a formal schema).Acknowledge relevant facts in 1-2 bold sentences.
Scope-check: if the artifact doesn't match Aurora (e.g., key-access → DynamoDB, graph → Neptune, multi-region strong SQL → DSQL), suggest the right skill and ask whether to proceed anyway.
Continue with this skill's sub-skill routing.
Files
- ATTRIBUTION.mdAdded by AutoGineer936 B
- LICENSELicence file added by AutoGineer9.9 KiB
- NOTICELicence file added by AutoGineer67 B
- SKILL.md19.0 KiB
- references/commitment-pricing-basics.md5.4 KiB
- references/commitment-pricing-instructions.md7.3 KiB
- references/commitment-pricing-mechanics.md6.0 KiB
- references/commitment-pricing-scenarios.md4.4 KiB
- references/commitment-pricing-skipped-cluster.md4.1 KiB
- references/commitment-pricing-worked-examples.md5.8 KiB
- references/create-instructions.md7.3 KiB
- references/express-create-comparison.md7.6 KiB
- references/express-create-connect-iam.md2.8 KiB
- references/express-create-constraints.md9.4 KiB
- references/express-create-documentation-links.md3.8 KiB
- references/express-create-feature-overview.md7.4 KiB
- references/express-create-instructions.md7.8 KiB
- references/express-create-migration-pgdump.md2.0 KiB
- references/express-create-migration.md7.5 KiB
- references/express-create-use-cases.md7.7 KiB
- references/io-optimized-data-collection.md4.2 KiB
- references/io-optimized-instructions.md6.9 KiB
- references/io-optimized-pricing-tables.md6.3 KiB
- references/io-optimized-pricing.md3.0 KiB
- references/io-optimized-worked-examples.md4.6 KiB
- references/serverless-advisory-concepts.md3.2 KiB
- references/serverless-advisory-formulas-and-examples.md4.5 KiB
- references/serverless-advisory-instructions.md7.0 KiB
- references/serverless-advisory-migration.md6.9 KiB
- references/serverless-advisory-worked-examples.md7.2 KiB
- references/shared-foundation-security-considerations.md5.4 KiB
- references/upgrade-planning-documentation-links.md2.1 KiB
- references/upgrade-planning-instructions.md5.6 KiB
- references/upgrade-planning-lts-recommendation.md4.9 KiB
- references/upgrade-planning-mode-b-discovery.md4.9 KiB
- references/upgrade-planning-mode-b-prechecks-checklists.md4.7 KiB
- references/upgrade-planning-post-checklist.md2.9 KiB
- references/upgrade-planning-post-upgrade-detail.md6.4 KiB
- references/upgrade-planning-post-upgrade-validation.md4.2 KiB
- references/upgrade-planning-pre-checklist.md2.2 KiB
- references/upgrade-planning-prechecks-postgresql.md7.0 KiB
- references/upgrade-planning-query-load-postgresql.md6.6 KiB
- scripts/acu_calculator.pyScript35.8 KiB
- scripts/commitment_pricing_analyzer.pyScript32.5 KiB
- scripts/io_optimized_analyzer.pyScript25.8 KiB
references/upgrade-planning-prechecks-postgresql.md
Aurora PostgreSQL Live Precheck Queries
Run these against the database to identify actual upgrade blockers and behavior changes.
Connection Methods
SSM Run Command
Credentials MUST be retrieved from Secrets Manager at runtime inside the command, so passwords never appear in SSM parameters, CloudTrail logs, or the instance's process list.
aws ssm send-command --instance-ids {instance_id} --document-name "AWS-RunShellScript" \
--parameters 'commands=["SECRET=$(aws secretsmanager get-secret-value --secret-id {secret_arn} --query SecretString --output text --region {region}) && PGPASSFILE=$(mktemp) && chmod 600 $PGPASSFILE && printf \"{endpoint}:5432:{database}:{username}:%s\\n\" \"$(echo $SECRET | jq -r .password)\" > $PGPASSFILE && PGPASSFILE=$PGPASSFILE psql -h {endpoint} -U {username} -d {database} -c \"{query}\"; rm -f $PGPASSFILE"]' \
--region {region} --output json --query "Command.CommandId"This writes the password to a temporary .pgpass file (chmod 600, removed after) rather than export PGPASSWORD, which is visible via /proc/<pid>/environ — matching the secure temp-file pattern used in the Aurora MySQL prechecks. Alternatively, prefer IAM database authentication where supported — it eliminates passwords entirely. See the AWS docs for enabling IAM auth on Aurora PostgreSQL.
If psql not installed:
Amazon Linux 2:
sudo yum install -y postgresqlAmazon Linux 2023:
sudo dnf install -y postgresql15Ubuntu:
sudo apt-get install -y postgresql-client
RDS Data API
aws rds-data execute-statement --resource-arn {cluster_arn} --secret-arn {secret_arn} \
--database {db} --sql "{query}" --region {region}Precheck Queries
1. Extensions and Versions
SELECT extname, extversion FROM pg_extension ORDER BY extname;Flag: Extensions that may not be available or changed in target version. Key ones: PostGIS, pg_partman, pglogical.
2. Hash Indexes (need REINDEX after upgrade from < PG 10)
SELECT schemaname, tablename, indexname, indexdef FROM pg_indexes WHERE indexdef LIKE '%USING hash%';Flag: 🟡 Must REINDEX after upgrade.
3. Unknown/Invalid Data Types
SELECT n.nspname, c.relname, a.attname, t.typname
FROM pg_attribute a
JOIN pg_class c ON a.attrelid = c.oid
JOIN pg_namespace n ON c.relnamespace = n.oid
JOIN pg_type t ON a.atttypid = t.oid
WHERE n.nspname NOT IN ('pg_catalog','information_schema','pg_toast')
AND t.typname IN ('unknown');Flag: 🔴 Unknown types block upgrade.
4. Logical Replication Slots
SELECT slot_name, plugin, slot_type, active, restart_lsn FROM pg_replication_slots;Flag: 🔴 ANY logical replication slot (active or inactive) blocks a major version upgrade — the pre-check fails until all are dropped. Confirm the slot's purpose, then drop unused slots. Even rows with active=false must be dropped (or restarted post-upgrade for pglogical).
5. Prepared Transactions
SELECT * FROM pg_prepared_xacts;Flag: 🔴 Prepared transactions BLOCK the upgrade.
6. Objects Owned by System Roles
SELECT n.nspname, c.relname, r.rolname as owner
FROM pg_class c
JOIN pg_namespace n ON c.relnamespace = n.oid
JOIN pg_roles r ON c.relowner = r.oid
WHERE r.rolname IN ('rdsadmin','rds_superuser')
AND n.nspname NOT IN ('pg_catalog','information_schema','pg_toast');Flag: 🟡 May block upgrades.
7. Database Encoding and Locale
SELECT datname, datcollate, datctype, encoding FROM pg_database
WHERE datname NOT IN ('template0','template1','rdsadmin');Flag: Verify locale compatibility with target version.
8. Custom Data Types
SELECT n.nspname, t.typname, t.typtype FROM pg_type t
JOIN pg_namespace n ON t.typnamespace = n.oid
WHERE n.nspname NOT IN ('pg_catalog','information_schema','pg_toast')
AND t.typtype IN ('c','e','d');9. Large/Critical Extensions
SELECT extname, extversion FROM pg_extension
WHERE extname IN ('postgis','postgis_topology','postgis_raster','pg_partman','pglogical','citus','pg_cron','pg_stat_statements');Flag: These have version-specific compatibility. Check target version supports them.
10. Table and Index Bloat (performance baseline)
SELECT schemaname, relname, n_live_tup, n_dead_tup,
CASE WHEN n_live_tup > 0 THEN round(n_dead_tup::numeric/n_live_tup::numeric * 100, 2) ELSE 0 END as dead_pct
FROM pg_stat_user_tables WHERE n_dead_tup > 10000 ORDER BY n_dead_tup DESC LIMIT 20;11. pg_stat_statements Top Queries (baseline)
SELECT calls, total_exec_time, mean_exec_time, query
FROM pg_stat_statements ORDER BY total_exec_time DESC LIMIT 10;12. Check for reg* Type Columns (can break cross-DB references)
SELECT n.nspname, c.relname, a.attname, t.typname
FROM pg_attribute a
JOIN pg_class c ON a.attrelid = c.oid
JOIN pg_namespace n ON c.relnamespace = n.oid
JOIN pg_type t ON a.atttypid = t.oid
WHERE t.typname IN ('regproc','regprocedure','regoper','regoperator','regconfig','regdictionary','regnamespace','regcollation')
AND n.nspname NOT IN ('pg_catalog','information_schema','pg_toast');Flag: 🔴 Unsupported reg* types block the upgrade (pg_upgrade can't persist them); remove before upgrading. regclass/regtype/regrole are exempt and survive.
13. Stale Table Statistics
SELECT schemaname, relname, n_live_tup, n_mod_since_analyze,
last_analyze, last_autoanalyze,
GREATEST(last_analyze, last_autoanalyze) AS last_stats_update,
EXTRACT(EPOCH FROM (now() - GREATEST(last_analyze, last_autoanalyze)))/86400 AS days_since_analyze
FROM pg_stat_user_tables
WHERE (last_analyze IS NULL AND last_autoanalyze IS NULL)
OR GREATEST(last_analyze, last_autoanalyze) < now() - interval '7 days'
ORDER BY n_live_tup DESC;Flag: 🟡 If statistics are older than 7 days (or never analyzed), recommend running ANALYZE on affected tables before the upgrade. Optimizer statistics are NOT transferred during an Aurora PostgreSQL major version upgrade — pg_upgrade does not carry over the contents of pg_statistic. After every major version upgrade you must run ANALYZE (e.g. ANALYZE VERBOSE;) on every database on all instances to regenerate statistics; otherwise the new planner runs with no statistics and can choose poor plans. Running ANALYZE pre-upgrade does not help post-upgrade because the stats are discarded. Capturing/refreshing stats before the upgrade is still useful for baselining plans, but the authoritative remediation is a full post-upgrade ANALYZE. Each major PostgreSQL version refines the planner's cost model, making it more dependent on accurate statistics.
Action: For each table with stale stats:
ANALYZE schema_name.table_name;For the entire database:
ANALYZE VERBOSE;Also consider VACUUM ANALYZE for tables with high dead tuple counts to reclaim space and refresh stats simultaneously.
Result Analysis
After running queries, generate:
Categorized findings (🔴/🟡/🟢)
For each finding: what was found, why it matters, action to take
Extension compatibility matrix for target version
Recommended post-upgrade REINDEX/ANALYZE plan
Requirements and compatibility
Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta
“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.
Needs: Needs an MCP server, Needs Python
Security
What our scanner noticed· Low risk
- Scripts that your agent may run
This skill includes scripts that your agent may run. Read them before you use it.
A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.
Attribution and licence
- Published by
- AWS
- Publisher
- AWS (Official)
- Source
- aws/agent-toolkit-for-aws · skills/specialized-skills/database-skills/amazon-aurora-postgresql · commit 0a218f8
- Licence
- Apache License 2.0 (redistribution allowed)
- LICENSE (added by AutoGineer from LICENSE)
- NOTICE (added by AutoGineer from NOTICE)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
AutoGineer is not affiliated with or endorsed by AWS or AWS.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download amazon-aurora-postgresql.zip