Programmatically get all tables of a database owned by a user
I created the following query:
select is_tables.table_name from information_schema.tables is_tables join
pg_tables on is_tables.table_name=pg_tables.tablename where
is_tables.table_catalog='<mydatabase>' and
is_tables.table_schema<>'information_schema' and
is_tables.table_schema<>'pg_catalog' and pg_tables.tableowner='<myuser>';
I assume there is no database vendor independent way of querying this. Is
this the easiest/shortest SQL query to achieve what I want in PostgreSQL?
No comments:
Post a Comment