ERROR: cannot execute CREATE TABLE in a read-only transaction

We’re getting a new error in many of our reports after updating to 0.35.4:
ERROR: cannot execute CREATE TABLE in a read-only transaction

(it’s CREATE TEMP TABLE, actually)

Is this a new Metabase “feature”, or did it coincide with my database (postgres) breaking somehow? It was working fine for months.
How do I solve this? I do NEED those temp tables.

Hi @DreamDweller
Which version did you upgrade from?
Did you also change something on Postgres, while upgrading Metabase? Which version of Postgres?
As far as I remember, when you create a temporary table in Postgres, it still needs to write information to pg_class, pg_attribute and probably other system tables.

Previous Metabase was 0.35.3, postgres 11.2.
I haven’t changed anything else.

@DreamDweller I don’t see any code changes that should have changed the behavior between 0.35.3 and 0.35.4
I guess you meant 0.34.3, since 0.35.0 introduced a lot of changes connection handling - among other readOnly was enforced and transactions was changed, since it caused a lot of problems.

Incredible, but not impossible that nobody’s looked at those reports since 0.35.0. So I guess there’s no solution and I’ll have to find another job, then. Thanks.

Edit: I succeeded in rewriting the logic to not use temp tables after all. Sorry for the drama.