postgresql

Design multi-tenant PostgreSQL schemas with Row-Level Security and Alembic migrations.

22|1|Updated Jan 10, 2026
One-click install
npx skills add https://github.com/itechmeat/llm-code --skill postgresql-itechmeat
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: postgresql
Source: https://github.com/itechmeat/llm-code/tree/main/skills/postgresql
Command: npx skills add https://github.com/itechmeat/llm-code --skill postgresql-itechmeat

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

PostgreSQL multi-tenant architectures often struggle with tenant isolation, scalable schema design, and maintaining consistent migrations. This Skill provides best practices to implement Row-Level Security, robust data models, and migration patterns to scale tenants safely. It guides teams through aligning authentication, runtime configuration, and auditing for multi-tenant PostgreSQL deployments.

Core Features & Use Cases

  • RLS-based tenant isolation patterns across tables and schemas to guarantee per-tenant data access
  • Alembic migration strategies for schema changes, indexes, RLS policies, and safe rollouts
  • Runtime configuration and query tuning considerations for high-traffic, tenant-isolated workloads
  • Use case: design a new tenant schema and migrate existing tenants with zero-downtime deployments

Quick Start

Start by applying the recommended RLS pattern and migration templates from this skill's README to your PostgreSQL setup, then adapt to your app's ORM layer.

Frequently Asked Questions about postgresql

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

FAQPage Schema
How do I implement Row-Level Security for multi-tenant isolation in PostgreSQL?

Row-Level Security (RLS) enables multi-tenant isolation in PostgreSQL by enforcing per-tenant data access policies across tables and schemas. This Skill provides RLS patterns to guarantee tenant-isolated queries and restrict data visibility based on runtime configuration.

What's the best way to manage Alembic migrations for PostgreSQL RLS policies?

Managing Alembic migrations for PostgreSQL RLS involves applying strategies for schema changes, indexes, and safe rollouts. This Skill guides migration patterns to update RLS policies and schema designs while maintaining zero-downtime deployments across existing tenants.

Does this PostgreSQL multi-tenant approach work with Async SQLAlchemy?

This PostgreSQL multi-tenant approach integrates with ORMs like Async SQLAlchemy. It requires familiarity with runtime configuration and Row-Level Security concepts to align authentication and tenant isolation within your application's ORM layer.

How does runtime configuration affect multi-tenant query tuning in PostgreSQL?

Runtime configuration drives multi-tenant query tuning in PostgreSQL by setting tenant contexts for high-traffic, tenant-isolated workloads. This Skill outlines performance tuning considerations to optimize query execution across production deployments using runtime variables.

Can I migrate existing tenants to a new schema with zero downtime in PostgreSQL?

Migrating existing tenants to a new PostgreSQL schema with zero downtime requires aligning Alembic migration strategies with RLS policies. This Skill provides templates to design tenant schemas and execute safe rollouts without disrupting active users.