Skip to content

Instantly share code, notes, and snippets.

View IsDon's full-sized avatar

Don Bloomfield IsDon

  • Defence Contractor, and Sole Trader (supporting current clients only at present)
  • Sydney, Australia
  • 20:29 (UTC +11:00)
View GitHub Profile
@michelmilezzi
michelmilezzi / idempotent_script.sql
Last active October 23, 2025 06:41
A simple script demonstrating PostgreSQL idempotent capabilities. You can run this script as many times as you wish (it will not give duplicate object error or similar).
--Table
CREATE TABLE IF NOT EXISTS person (
id integer NOT NULL,
person_name character varying(40) NOT NULL,
updated_date date,
CONSTRAINT person_pkey PRIMARY KEY (id)
);
--Index
CREATE INDEX IF NOT EXISTS idx_person_name ON person (person_name);