{"id":37143833,"url":"https://github.com/flanksource/postgres","last_synced_at":"2026-01-14T16:53:27.678Z","repository":{"id":307674921,"uuid":"1029673189","full_name":"flanksource/postgres","owner":"flanksource","description":null,"archived":false,"fork":false,"pushed_at":"2025-11-20T02:46:48.000Z","size":1058,"stargazers_count":0,"open_issues_count":15,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-01T06:47:25.834Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/flanksource.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-07-31T11:53:41.000Z","updated_at":"2025-11-07T10:18:47.000Z","dependencies_parsed_at":null,"dependency_job_id":"4849e278-6f67-4904-a612-5b1576d760ff","html_url":"https://github.com/flanksource/postgres","commit_stats":null,"previous_names":["flanksource/docker-postgres-upgrade","flanksource/postgres"],"tags_count":39,"template":false,"template_full_name":null,"purl":"pkg:github/flanksource/postgres","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flanksource%2Fpostgres","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flanksource%2Fpostgres/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flanksource%2Fpostgres/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flanksource%2Fpostgres/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/flanksource","download_url":"https://codeload.github.com/flanksource/postgres/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flanksource%2Fpostgres/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28426870,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T16:38:47.836Z","status":"ssl_error","status_checked_at":"2026-01-14T16:34:59.695Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-14T16:53:27.063Z","updated_at":"2026-01-14T16:53:27.669Z","avatar_url":"https://github.com/flanksource.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PostgreSQL with Extensions and Auto-Upgrades\n\nPostgreSQL distribution with automatic version upgrades, password recovery, performance auto-tuning, and 16 pre-compiled extensions. Optimized for Kubernetes deployments.\n\n## Key Features\n\n- **Automatic PostgreSQL upgrades** - Handles upgrade paths from 14→15→16→17 using pg_upgrade with hard links\n- **Password recovery** - Reset passwords without data loss using single-user mode in init containers\n- **PgTune auto-configuration** - Calculates optimal settings based on container memory/CPU limits\n- **16 pre-compiled extensions** - pgvector, pgsodium, pgjwt, pgaudit, pg_cron, and more included\n- **Connection pooling** - PgBouncer integrated with transaction pooling mode\n- **REST API** - PostgREST generates RESTful APIs from database schema\n- **Backup integration** - WAL-G configured for S3/GCS/Azure backups\n- **Helm charts** - Kubernetes deployment with StatefulSets, probes, and PVCs\n\n## ⚠️ Breaking Change: Security Update\n\n**Version 2.x** introduces a security improvement where the container now runs as the `postgres` user (UID 999) by default instead of root. This follows container security best practices and reduces the attack surface.\n\n### What Changed\n\n- **Previous behavior**: Container ran as root user\n- **New behavior**: Container runs as `postgres` user (UID 999) by default\n- **Impact**: Existing volumes with incorrect ownership will cause permission errors\n\n### Migration Guide\n\n#### For Docker Users\n\nIf you encounter permission errors after upgrading, fix volume ownership:\n\n```bash\n# Check current volume ownership\ndocker run --rm -v your-volume:/data alpine ls -la /data\n\n# Fix permissions (if owned by root or other user)\ndocker run --rm --user root -v your-volume:/data alpine chown -R 999:999 /data\n\n# Then start normally (will run as postgres user)\ndocker run -v your-volume:/var/lib/postgresql/data flanksource/postgres:17\n```\n\n**Recommended**: Use named volumes (Docker handles permissions automatically):\n\n```bash\ndocker run -d \\\n  -v pgdata:/var/lib/postgresql/data \\\n  -e PGPASSWORD=mypassword \\\n  ghcr.io/flanksource/postgres:17\n```\n\n#### For Kubernetes Users\n\nAdd `securityContext` to your Pod/StatefulSet spec:\n\n```yaml\napiVersion: v1\nkind: Pod\nspec:\n  securityContext:\n    runAsUser: 999\n    runAsGroup: 999\n    fsGroup: 999  # Ensures PVC is owned by postgres\n  containers:\n  - name: postgres\n    image: ghcr.io/flanksource/postgres:17\n    volumeMounts:\n    - name: pgdata\n      mountPath: /var/lib/postgresql/data\n```\n\n#### Permission Fix Mode\n\nIf you need to fix permissions on existing volumes, temporarily run as root:\n\n```bash\n# Run once as root to fix permissions\ndocker run --user root \\\n  -v your-volume:/var/lib/postgresql/data \\\n  ghcr.io/flanksource/postgres:17\n\n# Container will detect wrong ownership, fix it, and exit\n# Then restart without --user flag (runs as postgres by default)\ndocker run -v your-volume:/var/lib/postgresql/data \\\n  ghcr.io/flanksource/postgres:17\n```\n\n#### Validation\n\nUse `--dry-run` to validate permissions before starting:\n\n```bash\ndocker run --rm \\\n  -v your-volume:/var/lib/postgresql/data \\\n  --entrypoint postgres-cli \\\n  ghcr.io/flanksource/postgres:17 \\\n  auto-start --dry-run --data-dir /var/lib/postgresql/data\n```\n\n### Why This Change?\n\n- **Security**: Running as non-root reduces attack surface and follows least-privilege principle\n- **Compliance**: Aligns with container security best practices and PodSecurityStandards\n- **Consistency**: Matches official PostgreSQL Docker image behavior\n\n## Quick Start\n\n### Helm (Kubernetes)\n\n```bash\n# Add repository\nhelm repo add flanksource https://flanksource.github.io/charts\nhelm repo update\n\n# Install\nhelm install my-postgres flanksource/postgres \\\n  --set database.password=your-password\n```\n\n### Docker\n\n```bash\ndocker run -d \\\n  -e PGPASSWORD=mypassword \\\n  -p 5432:5432 \\\n  ghcr.io/flanksource/postgres:17\n```\n\n### CLI\n\n```bash\n# Install\ngo install github.com/flanksource/postgres/cmd@17\n\n# Generate configuration\npostgres-cli generate conf --memory=4GB --connections=200\n```\n\n## How postgres-cli Orchestrates Upgrades\n\nThe postgres-cli tool provides intelligent PostgreSQL version upgrades with zero data loss through a multi-phase orchestration process:\n\n### Upgrade Detection and Planning\n\n1. **Version Detection**: Reads `/var/lib/postgresql/data/PG_VERSION` to identify current version\n2. **Upgrade Path Planning**: Determines sequential upgrade steps (e.g., 14→15→16→17)\n3. **Validation**: Ensures data directory exists and PostgreSQL is stopped\n\n### Multi-Phase Upgrade Process\n\n```\nCurrent Data (v14) → Backup → Sequential Upgrades → Final Version (v17)\n                        ↓\n                  /backups/data-14 (preserved)\n```\n\nThe `Postgres.Upgrade()` method in `pkg/server/postgres.go` orchestrates:\n\n1. **Pre-upgrade Backup** (`backupDataDirectory`):\n   - Creates timestamped backup in `/var/lib/postgresql/data/backups/data-{version}`\n   - Preserves original data for rollback capability\n   - Excludes recursive backup/upgrade directories\n\n2. **Sequential Version Upgrades** (`upgradeSingle`):\n   - For each version hop (14→15, 15→16, 16→17):\n     - Validates current cluster with `pg_controldata`\n     - Initializes new cluster in `/var/lib/postgresql/data/upgrades/{version}`\n     - Runs `pg_upgrade --check` for compatibility verification\n     - Executes `pg_upgrade` with hard links (no data duplication)\n     - Validates upgraded cluster state\n     - Moves upgraded data to main location\n\n3. **Data Migration** (`moveUpgradedData`):\n   - Safely removes old version files from main directory\n   - Moves upgraded data from staging to production location\n   - Preserves backup and upgrade directories\n\n### Failure Protection\n\n- **Backup Preservation**: Original data always preserved in `/backups/data-{version}`\n- **Validation Checks**: Pre and post-upgrade cluster validation using `pg_controldata`\n- **Atomic Operations**: Each version upgrade is atomic with rollback capability\n- **Detailed Logging**: Captures stdout/stderr for debugging failed upgrades\n\n### Docker Container Integration\n\nThe Docker container orchestrates upgrades through a layered approach:\n\n1. **Entry Point** (`docker-entrypoint.sh`):\n   ```bash\n   # Auto-detection mode when no arguments provided\n   if [ $# -eq 0 ]; then\n       # Delegates to Task runner for orchestration\n       exec gosu postgres task auto-upgrade\n   fi\n   ```\n\n2. **Task Runner** (`Taskfile.run.yaml:auto-upgrade`):\n   ```bash\n   # Detects current version from PG_VERSION\n   CURRENT_VERSION=$(cat /var/lib/postgresql/data/PG_VERSION)\n   TARGET_VERSION=\"${PG_VERSION:-17}\"\n\n   # Calls postgres-cli for actual upgrade\n   exec postgres-cli upgrade --target-version $TARGET_VERSION\n   ```\n\n3. **CLI Command** (`cmd/server.go:createUpgradeCommand`):\n   - Parses target version from flags\n   - Creates `Postgres` instance with data directory\n   - Calls `Postgres.Upgrade(targetVersion)` for orchestration\n\n4. **Permission Handling**:\n   - Container starts as root for flexibility\n   - Uses `gosu postgres` to switch to postgres user\n   - Ensures proper file ownership throughout upgrade\n\n## Available Images\n\n| Image | Description |\n|-------|-------------|\n| `ghcr.io/flanksource/postgres:17` | PostgreSQL 17 with the ability to upgrade from 14 |\n| `ghcr.io/flanksource/postgres:16` | PostgreSQL 16 with the ability to upgrade from 14 |\n\n## Automatic Performance Tuning\n\nThe container detects resource limits and configures PostgreSQL accordingly:\n\n### Configuration Algorithm\n\n| Parameter | Calculation | Example (8GB RAM) |\n|-----------|-------------|-------------------|\n| `shared_buffers` | 25% of RAM | 2GB |\n| `effective_cache_size` | 75% of RAM | 6GB |\n| `work_mem` | RAM × 0.5% ÷ max_connections | 40MB |\n| `maintenance_work_mem` | 6.25% of RAM | 512MB |\n| `wal_buffers` | 3% of shared_buffers | 64MB |\n| `max_wal_size` | 2GB default | 2GB |\n\n### Resource Detection\n\n```yaml\n# Kubernetes\nresources:\n  limits:\n    memory: 8Gi    # Triggers auto-configuration\n    cpu: 4\n\n# Docker\ndocker run --memory=\"8g\" --cpus=\"4\" ...\n```\n\n### Manual Override\n\n```yaml\ndatabase:\n  config:\n    shared_buffers: \"4GB\"        # Override calculated value\n    max_connections: \"200\"       # Set explicitly\n```\n\n## Password Reset\n\nPassword recovery without data loss:\n\n### Kubernetes\n\n```bash\nhelm upgrade my-postgres flanksource/postgres \\\n  --set database.resetPassword=true \\\n  --set database.password=new-password \\\n  --reuse-values\n```\n\n### Docker\n\n```bash\ndocker run --rm \\\n  -v postgres_data:/var/lib/postgresql/data \\\n  -e RESET_PASSWORD=true \\\n  -e PGPASSWORD=new-password \\\n  ghcr.io/flanksource/postgres:17-17\n```\n\n### Implementation\n\n1. Starts PostgreSQL in single-user mode\n2. Updates password in pg_authid\n3. Restarts in normal multi-user mode\n4. No downtime for existing connections\n\n## Kubernetes Deployment\n\n### values.yaml\n\n```yaml\ndatabase:\n  version: \"17\"\n  password: \"change-me\"\n  autoUpgrade: true\n  resetPassword: false\n\nresources:\n  limits:\n    cpu: 4\n    memory: 8Gi\n  requests:\n    cpu: 2\n    memory: 4Gi\n\npersistence:\n  size: 100Gi\n  storageClass: fast-ssd\n\nextensions:\n  enabled: \"pgvector,pgsodium,pgaudit,pg_cron\"\n\npgbouncer:\n  enabled: true\n  poolMode: transaction\n  maxClientConn: 1000\n\npostgrest:\n  enabled: true\n  schemas: public\n\nwalg:\n  enabled: true\n  s3:\n    bucket: postgres-backups\n    region: us-east-1\n```\n\n### Deploy\n\n```bash\nhelm install my-postgres flanksource/postgres -f values.yaml\n```\n\n### Upgrade PostgreSQL Version\n\n```bash\nhelm upgrade my-postgres flanksource/postgres \\\n  --set database.version=17 \\\n  --reuse-values\n\nkubectl rollout restart statefulset/my-postgres\n```\n\n\n## Automatic Upgrades\n\nThe postgres-cli orchestrates safe, sequential PostgreSQL upgrades with full data preservation:\n\n\n\n### Upgrade Orchestration Details\n\n1. **Pre-Upgrade Validation** (`validateCluster`):\n   - Verifies PG_VERSION file matches expected version\n   - Runs `pg_controldata` to check cluster state\n   - Ensures data directory permissions are correct\n\n2. **New Cluster Initialization** (`initNewCluster`):\n   - Creates upgrade workspace: `/data/upgrades/{version}`\n   - Runs `initdb` for target PostgreSQL version\n   - Configures new cluster with same settings\n\n3. **pg_upgrade Execution** (`runPgUpgrade`):\n   ```bash\n   # Compatibility check first\n   pg_upgrade --check \\\n     --old-bindir=/usr/lib/postgresql/14/bin \\\n     --new-bindir=/usr/lib/postgresql/15/bin \\\n     --old-datadir=/var/lib/postgresql/data \\\n     --new-datadir=/data/upgrades/15\n\n   # Actual upgrade with hard links (no data duplication)\n   pg_upgrade \\\n     --old-bindir=/usr/lib/postgresql/14/bin \\\n     --new-bindir=/usr/lib/postgresql/15/bin \\\n     --old-datadir=/var/lib/postgresql/data \\\n     --new-datadir=/data/upgrades/15\n   ```\n\n4. **Data Migration** (`moveUpgradedData`):\n   - Removes old version files from main directory\n   - Moves upgraded data from `/data/upgrades/{version}` to main location\n   - Preserves backup directories for rollback capability\n\n### Environment Variables\n\n| Variable | Default | Description |\n|----------|---------|-------------|\n| `AUTO_UPGRADE` | `true` | Enable automatic version detection and upgrade |\n| `PG_VERSION` | `17` | Target PostgreSQL version for upgrades |\n| `START_POSTGRES` | `false` | Start PostgreSQL after successful upgrade |\n\n### Failure Recovery\n\nIf an upgrade fails:\n1. Original data remains in `/data/backups/data-{version}`\n2. Each upgrade step logs detailed output for debugging\n3. Manual recovery: `cp -r /data/backups/data-{version}/* /var/lib/postgresql/data/`\n\n## Configuration\n\n### Environment Variables\n\n#### PostgreSQL Core Settings\n\n| Variable | Description | Default | Example |\n|----------|-------------|---------|---------|\n| `PG_VERSION` | Target PostgreSQL version (14-17) | `17` | `16` |\n| `PGDATA` | PostgreSQL data directory | `/var/lib/postgresql/data` | Custom path |\n| `POSTGRES_DB` | Default database name | `postgres` | `myapp` |\n| `POSTGRES_USER` | Database superuser username | `postgres` | `admin` |\n| `PGPASSWORD` | Database password (direct) | - | `mySecurePassword` |\n| `PGPASSWORD_FILE` | Path to file containing password | - | `/run/secrets/db_password` |\n\n\n#### Auto-Configuration\n\n| Variable | Description | Default | Values |\n|----------|-------------|---------|--------|\n| `PG_TUNE` | Alias for PGCONFIG_AUTO_TUNE | `true` | `true`, `false` |\n| `POSTGRES_CLI_ARGS` | Custom postgres-cli arguments | See below | `--dry-run --pg-tune` |\n| `UPGRADE_ONLY` | Exit after upgrade (no start) | `false` | `true`, `false` |\n\n#### Performance Tuning (pg_tune)\n\n| Variable | Description | Default | Example |\n|----------|-------------|---------|---------|\n| `PG_TUNE_MAX_CONNECTIONS` | Override max connections | Auto-calculated | `200` |\n| `PG_TUNE_MEMORY` | Override memory in MB | Auto-detected | `8192` |\n| `PG_TUNE_CPUS` | Override CPU count | Auto-detected | `4` |\n| `PG_AUTH_METHOD` | Authentication method | `scram-sha-256` | `md5`, `trust` |\n\n\n\n## postgres-cli Reference\n\nThe `postgres-cli` tool provides comprehensive PostgreSQL management. It's included in the Docker image and can be installed standalone.\n\n### Installation\n\n```bash\n# Install CLI tool\ngo install github.com/flanksource/postgres/cmd@17\n\n# Or use Docker image\ndocker run --rm ghcr.io/flanksource/postgres:17 postgres-cli --help\n```\n\n### Global Flags\n\nAvailable for all commands:\n\n| Flag | Short | Description | Default | Example |\n|------|-------|-------------|---------|---------|\n| `--username` | `-U` | PostgreSQL username | `postgres` or `$PG_USER` | `-U admin` |\n| `--password` | `-W` | PostgreSQL password | `$PGPASSWORD` or `$PGPASSWORD_FILE` | `-W mypass` |\n| `--database` | `-d` | Database name | `postgres` or `$PG_DATABASE` | `-d myapp` |\n| `--host` | | PostgreSQL host | `localhost` or `$PG_HOST` | `--host db.example.com` |\n| `--port` | `-p` | PostgreSQL port | `5432` or `$PG_PORT` | `-p 5433` |\n| `--data-dir` | | Data directory path | `$PGDATA` or auto-detected | `--data-dir /pgdata` |\n| `--bin-dir` | | PostgreSQL binary directory | Auto-detected | `--bin-dir /usr/lib/postgresql/17/bin` |\n| `--config` | `-c` | Configuration file path | - | `-c /etc/postgresql.conf` |\n| `--locale` | | Database locale | `C` | `--locale en_US.UTF-8` |\n| `--encoding` | | Database encoding | `UTF8` | `--encoding UTF8` |\n| `--dry-run` | | Simulate without changes | `false` | `--dry-run` |\n\n### Commands\n\n#### auto-start\n\nAutomatically start PostgreSQL with optional pre-start tasks.\n\n```bash\npostgres-cli auto-start [flags]\n```\n\n**Flags:**\n\n| Flag | Description | Default |\n|------|-------------|---------|\n| `--auto-init` | Initialize database if not exists | `true` |\n| `--auto-upgrade` | Upgrade PostgreSQL if version mismatch | `true` |\n| `--auto-reset-password` | Reset password on startup | `true` |\n| `--pg-tune` | Run pg_tune optimization | `true` |\n| `--upgrade-to \u003cN\u003e` | Target PostgreSQL version | `0` (auto-detect 17) |\n| `--max-connections` | Max connections for pg_tune | `0` (auto-calculate) |\n| `--memory` | Override memory in MB | `0` (auto-detect) |\n| `--cpus` | Override CPU count | `0` (auto-detect) |\n| `--type` | Database type for pg_tune | `web` |\n| `--auth-method` | pg_hba.conf auth method | `scram-sha-256` |\n\n**Examples:**\n\n```bash\n# Start with all auto features\npostgres-cli auto-start\n\n# Initialize new database and start\npostgres-cli auto-start --auto-init\n\n# Upgrade to version 17 without starting\npostgres-cli auto-start --upgrade-to=17 --dry-run\n\n# Start with custom tuning\npostgres-cli auto-start --pg-tune --max-connections=200 --memory=8192\n```\n\n#### server Commands\n\nManage PostgreSQL server instances:\n\n```bash\npostgres-cli server \u003csubcommand\u003e [flags]\n```\n\n**Subcommands:**\n\n| Command | Description |\n|---------|-------------|\n| `status` | Show comprehensive PostgreSQL status |\n| `health` | Perform health check |\n| `start` | Start PostgreSQL server |\n| `stop` | Stop PostgreSQL server gracefully |\n| `restart` | Restart PostgreSQL server |\n| `initdb` | Initialize PostgreSQL data directory |\n| `reset-password` | Reset PostgreSQL superuser password |\n| `upgrade` | Upgrade PostgreSQL to target version |\n| `backup` | Create PostgreSQL backup using pg_dump |\n| `sql` | Execute SQL query |\n\n**Examples:**\n\n```bash\n# Check PostgreSQL status\npostgres-cli server status\n\n# Initialize new cluster\npostgres-cli server initdb --data-dir=/pgdata\n\n# Reset password\npostgres-cli server reset-password --password=newpass\n\n# Upgrade to version 17\npostgres-cli server upgrade --target-version=17\n\n# Execute SQL query\npostgres-cli server sql --query=\"SELECT version();\"\n\n# Execute SQL from file\npostgres-cli server sql --file=/path/to/script.sql\n```\n\n#### version\n\nShow version information:\n\n```bash\npostgres-cli version\n```\n\n### Usage Examples\n\n#### Docker Container Usage\n\nThe docker-entrypoint.sh automatically calls `postgres-cli auto-start`:\n\n```bash\n# Default behavior (all features enabled)\ndocker run ghcr.io/flanksource/postgres:17\n\n# Custom postgres-cli arguments\ndocker run -e POSTGRES_CLI_ARGS=\"--pg-tune --dry-run\" \\\n  ghcr.io/flanksource/postgres:17\n\n# Upgrade only (no start)\ndocker run -e UPGRADE_ONLY=true \\\n  -v pgdata:/var/lib/postgresql/data \\\n  ghcr.io/flanksource/postgres:17\n```\n\n#### Standalone CLI Usage\n\n```bash\n# Check status of local PostgreSQL\npostgres-cli server status --data-dir=/var/lib/postgresql/data\n\n# Upgrade local PostgreSQL installation\npostgres-cli server upgrade \\\n  --target-version=17 \\\n  --data-dir=/var/lib/postgresql/data\n\n# Generate optimized configuration\npostgres-cli auto-start \\\n  --pg-tune \\\n  --memory=8192 \\\n  --max-connections=200 \\\n  --dry-run\n\n# Connect to remote PostgreSQL\npostgres-cli server sql \\\n  --host=db.example.com \\\n  --port=5432 \\\n  --username=admin \\\n  --query=\"SELECT count(*) FROM users;\"\n```\n\n#### Password Management\n\n```bash\n# Reset password using environment variable\nexport PGPASSWORD=oldpass\nexport POSTGRES_PASSWORD=newpass\npostgres-cli server reset-password\n\n# Reset password using file\necho \"newpassword\" \u003e /tmp/password\npostgres-cli server reset-password \\\n  --password=$(cat /tmp/password)\nrm /tmp/password\n\n# Reset via auto-start\npostgres-cli auto-start --auto-reset-password\n```\n\n\n\n## Documentation\n\n- [Contributing Guide](CONTRIBUTING.md) - Development setup and guidelines\n- [Helm Chart Documentation](chart/README.md) - Chart configuration details\n- [Extension Examples](docs/extensions.md) - Extension usage\n- [Migration Guide](docs/migration.md) - Migrating from other distributions\n\n## Support\n\n- [GitHub Issues](https://github.com/flanksource/postgres/issues)\n- [GitHub Discussions](https://github.com/flanksource/postgres/discussions)\n- Security: security@flanksource.com\n\n## License\n\nApache License 2.0. See [LICENSE](LICENSE) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflanksource%2Fpostgres","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflanksource%2Fpostgres","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflanksource%2Fpostgres/lists"}