postgresql

Administer and optimize PostgreSQL databases.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "postgresql" with this command: npx skills add bagelhole/devops-security-agent-skills/bagelhole-devops-security-agent-skills-postgresql

PostgreSQL

Administer and optimize PostgreSQL databases.

Installation & Setup

Install

apt install postgresql postgresql-contrib

Access

sudo -u postgres psql

Create database and user

CREATE USER myapp WITH PASSWORD 'secret'; CREATE DATABASE mydb OWNER myapp; GRANT ALL PRIVILEGES ON DATABASE mydb TO myapp;

Configuration

/etc/postgresql/15/main/postgresql.conf

max_connections = 200 shared_buffers = 256MB effective_cache_size = 768MB work_mem = 4MB maintenance_work_mem = 64MB

Backup & Restore

Backup

pg_dump mydb > backup.sql pg_dump -Fc mydb > backup.dump # Custom format

Restore

psql mydb < backup.sql pg_restore -d mydb backup.dump

Replication

Primary

ALTER SYSTEM SET wal_level = replica; CREATE USER replicator REPLICATION LOGIN PASSWORD 'secret';

Replica

pg_basebackup -h primary -U replicator -D /var/lib/postgresql/15/main -P

Best Practices

  • Regular VACUUM and ANALYZE

  • Monitor slow queries

  • Implement connection pooling (PgBouncer)

  • Regular backups with pg_dump or pg_basebackup

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Security

linux-administration

No summary provided by upstream source.

Repository SourceNeeds Review
Security

sops-encryption

No summary provided by upstream source.

Repository SourceNeeds Review
Security

linux-hardening

No summary provided by upstream source.

Repository SourceNeeds Review
Security

windows-server

No summary provided by upstream source.

Repository SourceNeeds Review