Skip to content

Instantly share code, notes, and snippets.

@detj
Last active October 18, 2025 13:17
Show Gist options
  • Save detj/243a58e5113a63ad6a4cdd9d380821db to your computer and use it in GitHub Desktop.
Save detj/243a58e5113a63ad6a4cdd9d380821db to your computer and use it in GitHub Desktop.
List tables in postgres with custom schema
# List tables when using a custom schema other than 'public' in postgres
# 'BASE TABLE' table_type filter ensures only tables are listed and not views
#
# Replace <schema-name> with your schema name
select table_name from information_schema.tables where table_schema = '<schema-name>' and table_type = 'BASE TABLE';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment