cross-env-postgresql-extensions

Apply DO block patterns to create or drop PostgreSQL extensions across environments.

1|Updated Jan 12, 2026
One-click install
npx skills add https://github.com/jovermier/claude-code-plugins-ip-labs --skill cross-env-postgresql-extensions
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cross-env-postgresql-extensions
Source: https://github.com/jovermier/claude-code-plugins-ip-labs/tree/main/plugins/nhost/skills/cross-env-postgresql-extensions
Command: npx skills add https://github.com/jovermier/claude-code-plugins-ip-labs --skill cross-env-postgresql-extensions

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill provides a robust, cross-environment approach for PostgreSQL extension migrations by using a DO block pattern to handle privilege elevation, existence checks, and environment-specific differences.

Core Features & Use Cases

  • Cross-environment compatibility for enabling and disabling extensions across Nhost Cloud, CNPG, and standard PostgreSQL.
  • DO block pattern with exception handling to safely create and drop extensions without causing migration failures.
  • Guidance for common extensions (vector, postgis, pg_trgm, unaccent, etc.) and per-environment behavior.
  • Supports up.sql and down.sql migration scripts with idempotent creation and safe rollback.

Quick Start

Run a migration that creates or ensures an extension using the DO block pattern. For example, to enable the vector extension across environments, apply the up.sql pattern with the DO block followed by CREATE EXTENSION IF NOT EXISTS vector.

Frequently Asked Questions about cross-env-postgresql-extensions

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run PostgreSQL extension migrations across Nhost Cloud, CNPG, and standard PostgreSQL?

Cross-environment PostgreSQL extension migrations use a DO block pattern with SET ROLE and exception handling to safely manage extension lifecycles across Nhost Cloud, CNPG, and standard PostgreSQL environments.

How do I create a PostgreSQL extension in a migration without failing on permission errors?

Creating a PostgreSQL extension without failing involves applying a DO block pattern with exception handling. This approach safely executes CREATE EXTENSION IF NOT EXISTS while catching permission errors during the migration process.

What is the DO block pattern for PostgreSQL extension migrations?

The DO block pattern for PostgreSQL extension migrations wraps CREATE EXTENSION IF NOT EXISTS in exception handling and SET ROLE commands. This enables idempotent creation and safe rollback across environments with different privilege levels.

Can I use the same migration script for PostgreSQL extensions like vector and postgis across different environments?

Yes, a single migration script can manage common PostgreSQL extensions like vector, postgis, pg_trgm, and unaccent across environments. The DO block pattern handles environment-specific behaviors and privilege differences automatically.

Why do my PostgreSQL extension migrations fail when moving from standard PostgreSQL to Nhost Cloud?

PostgreSQL extension migrations fail across environments due to permission differences. Using a DO block pattern with SET ROLE and exception handling resolves these failures by safely managing privilege elevation and extension existence checks.

How do I write idempotent up.sql and down.sql scripts for PostgreSQL extension management?

Idempotent up.sql and down.sql scripts for PostgreSQL extensions use the DO block pattern. The up.sql applies CREATE EXTENSION IF NOT EXISTS safely, while down.sql ensures safe rollback by dropping extensions with exception handling.