| title | pg hardstorage db install-extension | ||
|---|---|---|---|
| description | CLI reference for the pg hardstorage db install-extension command. | ||
| tags |
|
Install the pg_hardstorage in-DB extension (creates schema + tables + views + functions)
Runs the bundled extension SQL against the target PostgreSQL cluster. Creates:
- the pg_hardstorage schema
- the *_state authoritative tables
- the .backups / .health / .rpo views
- the upsert_* helper functions
- the pg_hardstorage_writer role
Idempotent: re-running is safe (CREATE OR REPLACE semantics).
The command shells out to psql and pipes the SQL on stdin.
psql must be on the PATH; every PG host has it.
Use --dry-run to print what would be executed without applying it; --print-sql to write the embedded SQL to stdout (useful for piping to a different tool).
pg_hardstorage db install-extension [flags]
--dry-run don't apply; report what would be installed
-h, --help help for install-extension
--pg-connection string libpq connection string for the target PostgreSQL cluster
--print-sql print the embedded SQL to stdout (no PG connection required)
--airgapped airgapped: strict refuse outbound endpoints (LLM providers, sinks, OTLP collectors) outside loopback / RFC1918 / explicit airgap.allowlist. Also enabled by PG_HARDSTORAGE_AIRGAPPED=1 or airgapped: strict in the config file.
-c, --config string path to config file (default: XDG/FHS lookup)
--cpu-profile go tool pprof <path> write a pprof CPU profile to this path for the duration of the command (go tool pprof <path> to analyse). Off when empty.
--mem-profile string write a pprof heap profile to this path at command exit. Off when empty.
--no-color disable ANSI color in text output
--on-error-llm on a structured-error failure, drop into the matching LLM helper skill (auto_on_error trigger). Also enabled by PG_HARDSTORAGE_ON_ERROR_LLM=1.
--otel-endpoint string OpenTelemetry OTLP/HTTP endpoint (e.g. http://otel-collector:4318); empty disables tracing
--otel-stdout also export OpenTelemetry traces to stderr (useful for dev)
-o, --output string output format: text|json|ndjson|yaml|template|csv|markdown|html|tap|junit|pdf (default: text on TTY, json off-TTY)
--profile-port go tool pprof http://127.0.0.1:6060/debug/pprof/profile?seconds=30 if non-zero, expose net/http/pprof on 127.0.0.1:<port> for live profiling of long-running commands (e.g. go tool pprof http://127.0.0.1:6060/debug/pprof/profile?seconds=30). Off when zero.
-q, --quiet suppress non-essential output
--template string Go text/template applied when --output template (or implied if --template is set without --output)
- pg_hardstorage db - In-database integration (SQL views, upsert helpers)