Przejdź do treści
Biblioteka skilli
Programowanie · Budowanie i kod

sql-postgresql-guide

/sql-postgresql-guide

Podpowiada przy zapytaniach, schematach i migracjach w PostgreSQL 15+: CTE, indeksy, JSONB, RLS, EXPLAIN ANALYZE i ograniczenia.

Repozytorium
platform ↗
Licencja
MIT
Ostatnia zmiana repozytorium
08.10.2026

Ocena i bezpieczeństwo

90/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść25 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
13
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
0
Przestarzałość

Brak sygnałów. Repozytorium zmienione 08.10.2026, bez odwołań do wycofanych modeli i API.

Licencja

MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.

Co robi i kiedy

Podpowiada przy zapytaniach, schematach i migracjach w PostgreSQL 15+: CTE, indeksy, JSONB, RLS, EXPLAIN ANALYZE i ograniczenia.

Wyzwalacze z opisu

t say
Oryginalny opis (EN)

Use when editing PostgreSQL 15+ queries, schemas, or migrations. Triggers on `.sql` files, migration files, schema files, and prompts about CTEs, indexing, JSONB, RLS, EXPLAIN ANALYZE, or constraints, even when the user doesn't say 'Postgres'.

Jak działa

  1. Requirements
  2. Essentials
  3. Gotchas
  4. Progressive disclosure
Sekcje z nagłówków SKILL.md, w oryginale · 36 linii, 287 słów
Podgląd SKILL.md
---
name: sql-postgresql-guide
description: "Use when editing PostgreSQL 15+ queries, schemas, or migrations. Triggers on `.sql` files, migration files, schema files, and prompts about CTEs, indexing, JSONB, RLS, EXPLAIN ANALYZE, or constraints, even when the user doesn't say 'Postgres'."
---

# PostgreSQL Coding Guidelines

Write PostgreSQL queries and schemas with explicit constraints, transactional changes, and measured query plans.

## Requirements

- PostgreSQL ≥ 15.

## Essentials

- **Query composition** - Use CTEs to decompose complex queries, name descriptively, see [references/cte-patterns.md](references/cte-patterns.md)
- **Schema design** - Choose precise types, index for access paths, avoid over-indexing, see [references/data-types.md](references/data-types.md), [references/indexing.md](references/indexing.md)
- **Data integrity** - Enforce with PK/FK/UNIQUE/CHECK/NOT NULL constraints, see [references/constraints.md](references/constraints.md)
- **Semi-structured data** - Use JSONB with GIN indexes, see [references/jsonb.md](references/jsonb.md)
- **Multi-tenancy** - Apply RLS and role-based access for data isolation, see [references/row-level-security.md](references/row-level-security.md), [references/role-based-access.md](references/role-based-access.md)
- **Performance** - Analyze query plans and tune, see [references/performance.md](references/performance.md)

## Gotchas

- `ANALYZE` updates planner statistics: bulk inserts without re-analyzing produce stale plans and full scans
- `JSONB` supports indexing (GIN); `JSON` doesn't: pick JSONB unless you specifically need preserved formatting
- Most DDL participates in transactions, but commands such as `CREATE INDEX CONCURRENTLY` cannot run inside a transaction block: check every migration operation before wrapping the whole file
- Prefer SQL-standard `GENERATED ... AS IDENTITY` for new auto-generated keys because its sequence relationship and override rules are declared on the column; `SERIAL`/`BIGSERIAL` remain supported PostgreSQL shorthand, not deprecated syntax

## Progressive disclosure

- Read [references/cte-patterns.md](references/cte-patterns.md) - Load when breaking down complex queries or improving readability
- Read [references/data-types.md](references/data-types.md) - Load when choosing column types or avoiding type mismatches
- Read [references/indexing.md](references/indexing.md) - Load when optimizing slow queries or query planning
- Read [references/constraints.md](references/constraints.md) - Load when enforcing data integrity rules
- Read [references/jsonb.md](references/jsonb.md) - Load when storing semi-structured or dynamic data
- Read [references/row-level-security.md](references/row-level-security.md) - Load when implementing multi-tenant data isolation
- Read [references/role-based-access.md](references/role-based-access.md) - Load when configuring database user permissions
- Read [references/performance.md](references/performance.md) - Load when analyzing query plans or tuning performance
Pliki w paczce (13)
  • SKILL.md 3 KB
  • SOURCES.md 1 KB
  • eval-queries.json 5 KB
  • evals.json 3 KB
  • moon.yml 1 KB
  • references/constraints.md 1 KB
  • references/cte-patterns.md 1 KB
  • references/data-types.md 1 KB
  • references/indexing.md 1 KB
  • references/jsonb.md 1 KB
  • references/performance.md 1 KB
  • references/role-based-access.md 1 KB
  • references/row-level-security.md 1 KB

Wersje

W bazie nie ma innych skilli o nazwie sql-postgresql-guide.

Migawka bazy z 13.11.2026 · wersja paczki fbb28889c678 (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 0 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 100postgresql
    Pomaga projektować schematy PostgreSQL, optymalizować zapytania, indeksować i administrować: JSONB, partycjonowanie, RLS, CTE, funkcje okna, EXPLAIN ANALYZE i pule połączeń.
  • 90postgresql
    Wspiera projekt schematu PostgreSQL, optymalizację zapytań, indeksowanie i administrację: JSONB, partycjonowanie, RLS, CTE, funkcje okna i EXPLAIN ANALYZE.
  • 100postgres-code-review
    Przegląda kod PostgreSQL pod kątem strategii indeksowania, operacji JSONB, puli połączeń i bezpieczeństwa transakcji, w zapytaniach SQL i schematach.
  • 90postgres-best-practices
    Sprawdza zapytania, schemat i konfigurację PostgreSQL według 33 zasad wpływu, obejmujących pule połączeń, RLS, blokady, VACUUM i indeksy JSONB.
  • 100postgresql
    Pomaga projektować schematy, pisać wydajne zapytania, zarządzać indeksami i obsługiwać bazy PostgreSQL z JSONB, wyszukiwaniem pełnotekstowym, funkcjami okna, CTE, row-level security i replikacją.
  • 86postgresql
    Pomaga projektować bazy PostgreSQL, optymalizować zapytania SQL, pisać procedury i zapytania JSONB.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.