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.

Revisions

  1. detj revised this gist Oct 18, 2025. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion list-tables-postgresh.sql
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,5 @@
    # 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
    select table_name from information_schema.tables where table_name = '<name>' and table_type = 'BASE TABLE';
    #
    # Replace <schema-name> with your schema name
    select table_name from information_schema.tables where table_schema = '<schema-name>' and table_type = 'BASE TABLE';
  2. detj created this gist Oct 18, 2025.
    3 changes: 3 additions & 0 deletions list-tables-postgresh.sql
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,3 @@
    # 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
    select table_name from information_schema.tables where table_name = '<name>' and table_type = 'BASE TABLE';