Can't run simple SQL queries

Hi all, new to Metabase and seriously impressed. I linked my PostgreSQL database, asked some questions, created a dashboard and all is looking fine. I am now trying to build a slightly more complex question using the SQL query feature. Ran into the timezone bug but found a workaround in the forums by setting the timezone to the default value.

The query I am trying to run:

SELECT * FROM transactions WHERE payment_status = "PAID";

But Metabase answers with:

ERROR: column "PAID" does not exist Position: 51

Well, yeah, “PAID” is a value, not a column.

Any idea what I am doing wrong here? It looks like a perfectly normal SQL query to me. Simpler queries like SELECT * FROM transactions do work.

Try changing "PAID" to 'PAID'.

PostgreSQL uses only single quotes for this (i.e. WHERE name = ‘John’). Double quotes are used to quote system identifiers; field names, table names, etc. (i.e. WHERE “last name” = ‘Smith’).

https://wiki.postgresql.org/wiki/Things_to_find_out_about_when_moving_from_MySQL_to_PostgreSQL

1 Like

Yes, that did the trick! Thanks Tom! It does work in my PosgreSQL client, guess it’s a little too smart.