Relation "queries" does not exist



I am getting below error while running Redash. Should i be creating table “queries”? Could you help to resolve this issue?

Task redash.tasks.refresh_queries raised unexpected: ProgrammingError(‘ERROR’, ‘42P01’, ‘relation “queries” does not exist’, ‘436’, ‘parse_relation.c’, ‘1159’, ‘parserOpenTable’, ‘’, ‘’)

-ERROR/Worker-49] SELECT “t1”.“id”, “t1”.“updated_at”, “t1”.“created_at”, “t1”.“data_source_id”, “t1”.“latest_query_data_id”, “t1”.“name”, “t1”.“description”, “t1”.“que
ry”, “t1”.“query_hash”, “t1”.“api_key”, “t1”.“user_email”, “t1”.“user_id”, “t1”.“last_modified_by_id”, “t1”.“is_archived”, “t1”.“schedule”, “t2”.“retrieved_at”, “t3”.“id”, “t3”.“name”, “t3”.“ty
pe”, “t3”.“options”, “t3”.“queue_name”, “t3”.“scheduled_queue_name”, “t3”.“created_at” FROM “queries” AS t1 INNER JOIN “query_results” AS t2 ON (“t1”.“latest_query_data_id” = “t2”.“id”) INNER J
OIN “data_sources” AS t3 ON (“t1”.“data_source_id” = “t3”.“id”) WHERE (“t1”.“schedule” IS NOT %s) [None]
Traceback (most recent call last):



It’s hard to help without proper context and details about your setup. But in general, yes - you need to create this table and the other ones Redash uses.

You can do this with the CLI ( with the database create_tables command.


Sometimes I find this when starting my dev environment.

With me, this usually happens when the database is not properly initialized.

So what I execute is: docker-compose up postgres

… and in another tab I execute the ./setup/docker/

then I execute docker-compose up -d and start working again :slight_smile: