How can I use schema in native SQL query through API?

How can I tell the API to use schema name (in backend PostgreSQL) ?
I am using 0.36.6.

Without schema, it WORKs;

“native”:{“query”:“SELECT count(*) FROM ORDERS”},

where database_id=1 is sample dataset bundled by metabase.

With schema, it DOESN’T WORK;

“native”:{“query”:“SELECT count(*) FROM my_schema.my_table”},

where database=2 is PostgreSQL as the backend, and I use schema there.

this returns an error message (in huge JSON);

“ERROR: relation “my_schema” does not exist\n Position: 140”

Many thanks in advance.


Hi @moto
Do you have credentials to actually see that schema? Does the schema show in the Metabase GUI?