No operator matches the given name and argument type(s). You might need to add explicit type cast

Hi,

we are using Metabase that connects to PostgreSQL. After upgrading to the 0.35.3 version, we get the following error:

ERROR: operator does not exist: timestamp with time zone / integer Suggerimento: No operator matches the given name and argument type(s). You might need to add explicit type casts.

We have added a custom column that is a sum of two columns. The resulting query produced by Metabse is:

    select
	to_timestamp(("source"."agg_event_timestamp" / 1000)) as "agg_event_timestamp",
	"source"."agg_sum_successcount" as "agg_sum_successcount",
	"source"."agg_sum_throttlecount" as "agg_sum_throttlecount",
	"source"."agg_sum_total" as "agg_sum_total"
from
	(
	select
		("public"."apim_reqcountagg_days"."agg_sum_successcount" + "public"."apim_reqcountagg_days"."agg_sum_throttlecount") as "agg_sum_total",
		to_timestamp(("public"."apim_reqcountagg_days"."agg_event_timestamp" / 1000)) as "agg_event_timestamp",
		"public"."apim_reqcountagg_days"."agg_sum_successcount" as "agg_sum_successcount",
		"public"."apim_reqcountagg_days"."agg_sum_throttlecount" as "agg_sum_throttlecount"
	from
		"public"."apim_reqcountagg_days") "source"

where agg_sum_total is the custom column. In our previous version (0.34.3), the query produced by Metabase was:

select
	to_timestamp(("public"."apim_reqcountagg_days"."agg_event_timestamp" / 1000)) as "agg_event_timestamp",
	"public"."apim_reqcountagg_days"."agg_sum_successcount" as "agg_sum_successcount",
	"public"."apim_reqcountagg_days"."agg_sum_throttlecount" as "agg_sum_throttlecount",
	("public"."apim_reqcountagg_days"."agg_sum_successcount" + "public"."apim_reqcountagg_days"."agg_sum_throttlecount") as "agg_sum_total"
from
	"public"."apim_reqcountagg_days"

Any suggestions?
Thank you
Francesco

Hi @francesco_a
That looks very strange - can you open an issue on this?
https://github.com/metabase/metabase/issues/new/choose
Can you also include the Postgres column type of agg_event_timestamp - and the Field Type (Admin > Data Model)

For reference:
https://github.com/metabase/metabase/issues/12430 - upvote by clicking :+1: on the first post