Skip to content

Instantly share code, notes, and snippets.

View norbertbuchmueller's full-sized avatar

Norbert Buchmüller norbertbuchmueller

View GitHub Profile
@norbertbuchmueller
norbertbuchmueller / pg-domain-type-demo.sql
Last active July 17, 2018 15:39
demo of the PostgreSQL domain type - a possble replacement for the PostgreSQL enum types
BEGIN;
-- note: the downside of a DOMAIN type in pg is that the type cannot be modified if it's used in
-- a composite-type column as yet (i hope we don't do that)
-- pgTAP is a suite of test functions to test SQL scripts on PostgreSQL - see https://pgtap.org/
CREATE EXTENSION IF NOT EXISTS pgtap;
-- we will have 4 pgTAP tests
SELECT plan(4);