Skip to content

Instantly share code, notes, and snippets.

@awsiv
Last active February 12, 2020 16:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save awsiv/9c3cbeb41fb358394f986c637d07fcae to your computer and use it in GitHub Desktop.
Save awsiv/9c3cbeb41fb358394f986c637d07fcae to your computer and use it in GitHub Desktop.
SQL queries
--- select indexes
SELECT tablename, indexname, indexdef FROM pg_indexes WHERE schemaname = 'public' ORDER BY tablename, indexname;
--- list functions
\df public.*
--- list lastvalue
SELECT MAX(id) FROM <table name>;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment