There is only one truth. It is the source.
May 15, 2014
Tags: postgresql
DO $$ BEGIN IF NOT EXISTS ( SELECT 1 FROM pg_indexes WHERE indexname = 'profile_profile_middle_name' AND schemaname = 'public' ) THEN CREATE INDEX profile_profile_middle_name ON profile_profile USING btree (middle_name COLLATE pg_catalog."default" ); END IF; END$$;