| name | postgresql-fundamentals |
| description | Master PostgreSQL SQL fundamentals - data types, tables, constraints, schema design |
| version | 3.0.0 |
| sasmp_version | 1.3.0 |
| bonded_agent | 01-postgresql-fundamentals |
| bond_type | PRIMARY_BOND |
| category | database |
| difficulty | beginner |
| estimated_time | 2h |
PostgreSQL Fundamentals Skill
Atomic skill for SQL foundations and schema design
Overview
Production-ready patterns for PostgreSQL 16+ data modeling, including type selection, constraint design, and schema organization.
Prerequisites
- PostgreSQL 16+ installed
- Basic SQL knowledge
- Database access with CREATE privileges
Parameters
parameters:
operation:
type: string
required: true
enum: [create_table, add_constraint, select_type, design_schema]
table_name:
type: string
pattern: "^[a-z][a-z0-9_]*$"
schema:
type: string
default: "public"
Quick Reference
Data Type Selection
| Use Case | Recommended | Avoid |
|---|
| Primary key | BIGINT GENERATED ALWAYS AS IDENTITY | SERIAL |
| Monetary | NUMERIC(19,4) | FLOAT |
| Timestamps | TIMESTAMPTZ | TIMESTAMP |
| UUID | UUID | VARCHAR(36) |
| JSON data | JSONB | JSON |
Table Template
CREATE TABLE schema_name.table_name (
id BIGINT GENERATED ALWAYS ,
created_at TIMESTAMPTZ NOW(),
updated_at TIMESTAMPTZ NOW()
);