Skip to content

Instantly share code, notes, and snippets.

@hooopo
Created May 9, 2019 20:45
Show Gist options
  • Save hooopo/46fbb35bf4480bd42b4e28cdab2f2b81 to your computer and use it in GitHub Desktop.
Save hooopo/46fbb35bf4480bd42b4e28cdab2f2b81 to your computer and use it in GitHub Desktop.
SELECT pg_get_indexdef(indexrelid) FROM pg_index WHERE indrelid = 'public.companies'::regclass AND indisprimary = 'f';
pg_get_indexdef
---------------------------------------------------------------------------------------------------------
CREATE INDEX index_companies_on_company_edition_id ON public.companies USING btree (company_edition_id)
CREATE UNIQUE INDEX index_companies_on_uuid ON public.companies USING btree (uuid)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment