Skip to content

Instantly share code, notes, and snippets.

@syntaqx
Last active November 8, 2023 21:36
Show Gist options
  • Save syntaqx/a80c435e64a2a844bb21922798864001 to your computer and use it in GitHub Desktop.
Save syntaqx/a80c435e64a2a844bb21922798864001 to your computer and use it in GitHub Desktop.
INSERT INTO customers (name, email, created_by)
VALUES ('John Doe', 'john.doe@example.com', ROW('namespace1', '12345'));
CREATE TYPE urn AS (
namespace TEXT,
identifier TEXT
);
CREATE TABLE customers (
customer_id SERIAL PRIMARY KEY,
name TEXT NOT NULL,
email TEXT UNIQUE NOT NULL,
created_by urn, -- Using the custom "urn" type
created_at TIMESTAMP DEFAULT NOW()
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment