Attempting to run a simply query:
SELECT t.table_name
FROM information_schema.tables AS t
JOIN pg_index i
ON i.indrelid = t.table_name::regclass
I'm getting an error:
ERROR: relation "account" does not exist
SQL state: 42P01
From my understanding I need to cast the t.table_name with ::regclass in order to compare against indrelid. I'm assuming it's not working because the table is in another schema other than the public schema. How do I run this query to include tables in schemas other than the public schema?
db structure:
schema: public
tables: n/a
schema: core
tables: account, collection