initialize-pgdb

Create PostgreSQL databases and users with generated passwords on specified hosts.

8|1|Updated Oct 21, 2015
One-click install
npx skills add https://github.com/iamruinous/nix-config --skill initialize-pgdb
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: initialize-pgdb
Source: https://github.com/iamruinous/nix-config/tree/main/.opencode/skills/initialize-pgdb
Command: npx skills add https://github.com/iamruinous/nix-config --skill initialize-pgdb

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Automates the creation of PostgreSQL databases and users across configured hosts, eliminating repetitive manual setup and reducing the risk of misconfigurations.

Core Features & Use Cases

  • Create a new database on a targeted host with an associated user.
  • Generate a secure password and grant basic privileges.
  • Integrate into automation pipelines to bootstrap per-service environments across multiple hosts.

Quick Start

Initialize a database named <db_name> on <host> with a new user and a generated password.

Frequently Asked Questions about initialize-pgdb

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I automate PostgreSQL database and user creation across multiple hosts?

You can automate PostgreSQL database and user creation by running a workflow that provisions a new database and matching user on a chosen host. This eliminates repetitive manual setup and reduces the risk of misconfigurations across your infrastructure.

How does secure password generation work when creating a new PostgreSQL user?

Secure password generation for a new PostgreSQL user is enforced automatically during the database creation workflow. The system generates a strong password and grants basic privileges to the user, ensuring secure access without manual intervention.

Can I use this to provision per-service PostgreSQL databases for Docker environments?

Yes, you can provision per-service PostgreSQL databases and output connection strings specifically formatted for Docker usage. This allows you to easily integrate the newly created database credentials into your containerized application environments.

What's the best way to bootstrap PostgreSQL environments across different host machines?

The best way to bootstrap PostgreSQL environments across different hosts is to use an automation pipeline that applies host-specific access grant steps. This ensures each targeted host receives a properly configured database and user with the correct privileges.

Does this workflow output connection strings for external application usage?

Yes, the workflow outputs connection strings for both Docker and external usage after creating the PostgreSQL database and user. These strings allow your applications to connect to the newly provisioned database without manually constructing the connection parameters.

What are the limitations of automating PostgreSQL database creation across multiple hosts?

A limitation is that automation is restricted to specific configured hosts, meaning you cannot dynamically provision databases on unregistered machines. Additionally, the workflow grants only basic privileges, which may require manual elevation for advanced database roles.