Skip to content

hello_world

A simple hello-world Postgres extension using sql/plpgsql implementing a russian roulette function.

hello_world · A simple hello-world Postgres extension using sql/plpgsql implementing a russian roulette function.

Overview

IDExtensionPackageVersionCategoryLicenseLanguage
101397hello_worldhello_world1.0FUNCUnknownSQL

Usage

Sources:

hello_world — A simple PostgreSQL extension that demonstrates basic extension functionality using SQL only (no C code compilation required). Use it when SQL needs these specialized functions or aggregates. Use the pinned upstream revision linked above as the API boundary and test it on the target PostgreSQL build.

Core Workflow

CREATE EXTENSION hello_world;

Install the extension in the intended database, run the smallest upstream example above when available, and verify the installed version and returned values before integrating it into application SQL.

Important Objects

  • hello_world() is an extension function and returns TEXT.
  • hello_world(name TEXT) is an extension function and returns TEXT.
  • log_hello_world(message TEXT DEFAULT 'Hello, World!') is an extension function and returns INTEGER.
  • russian_roulette(target_user_id INTEGER, odds INTEGER DEFAULT 6) is an extension function and returns TEXT.
  • hello_world_log is a table installed or managed by the extension.

Requirements and Caveats

  • The reviewed control file declares default version 1.0.
  • The control file marks the extension as relocatable.
  • Confirm privileges, supported PostgreSQL versions, upgrade behavior, and failure cases against the pinned source before production use.

Table reader