Skip to content

Commit

Permalink
List only permanent tables (#113)
Browse files Browse the repository at this point in the history
  • Loading branch information
faridco authored Apr 13, 2024
1 parent 606f26b commit 8f33089
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/pg_easy_replicate/helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,12 @@ def list_all_tables(schema:, conn_string:)
Query
.run(
query:
"SELECT table_name
FROM information_schema.tables
WHERE table_schema = '#{schema}' AND
table_type = 'BASE TABLE'
"SELECT c.relname::information_schema.sql_identifier AS table_name
FROM pg_namespace n
JOIN pg_class c ON n.oid = c.relnamespace
WHERE c.relkind = 'r'
AND c.relpersistence = 'p'
AND n.nspname::information_schema.sql_identifier = '#{schema}'
ORDER BY table_name",
connection_url: conn_string,
user: db_user(conn_string),
Expand Down

0 comments on commit 8f33089

Please sign in to comment.