Metabase Variable Filters for Postgres

I am running Metabase and PostgresSQL in Docker.

SQL query works fine. But its just Variable Filter in Metabase won't activate for my database.

select * from 
test_schema."Project" as pj 

where pj."Division" = {{"The Filter"}}

Any help here is really appreciated.


Hi @mcbenly

Post "Diagnostic Info" from Admin > Troubleshooting.

There's no quotes, spaces or dots in variable names. Just use {{the_filter}}

Please read these two articles:

Thanks for your reply @flamber
Tried without quotes, but still no luck!

Here is the "Diagnostic Info" from Admin > Troubleshooting

"browser-info": {
"language": "en-US",
"platform": "MacIntel",
"userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:99.0) Gecko/20100101 Firefox/99.0",
"vendor": ""
"system-info": {
"file.encoding": "UTF-8",
"": "OpenJDK Runtime Environment",
"java.runtime.version": "",
"java.vendor": "Eclipse Adoptium",
"java.vendor.url": "",
"java.version": "",
"": "OpenJDK 64-Bit Server VM",
"java.vm.version": "",
"": "Linux",
"os.version": "5.10.104-linuxkit",
"user.language": "en",
"user.timezone": "GMT"
"metabase-info": {
"databases": [
"hosting-env": "unknown",
"application-database": "h2",
"application-database-details": {
"database": {
"name": "H2",
"version": "1.4.197 (2018-03-18)"
"jdbc-driver": {
"name": "H2 JDBC Driver",
"version": "1.4.197 (2018-03-18)"
"run-mode": "prod",
"version": {
"date": "2022-04-07",
"tag": "v0.42.4",
"branch": "release-x.42.x",
"hash": "7c3ce2d"
"settings": {
"report-timezone": null

@mcbenly You can make normal queries via the GUI right?
Try creating a query like this - I can guarantee it works - there's millions of Metabase users.

select {{test}}

If you are planning on running Metabase in production, then make sure you set it up correctly:

Thanks @flamber
Yes, the test works fine. Thanks.

Thanks for the heads-up! currently testing out the functionality of Metabase. Will definitely run Metabase in production to see if the same issue. Will update if it is resolved.

Thanks for the quick turn-around by the way! really appreciate it.

@mcbenly Switching the application database will not change anything regarding how Metabase works. It will just avoid you losing all data if you deleted the container, since the H2 file is stored inside the container by default.

@flamber true! It's work now :slight_smile:

I think variable filter doesn't take spaces in the brackets.

Working query...

select * from
test_schema."Project" as pj
where pj."Division" = {{Filter}}