From 08dc08550c34d8c38f89351acce0a4aea089edf4 Mon Sep 17 00:00:00 2001 From: Anton Hvornum Date: Sun, 8 Oct 2017 20:37:16 +0200 Subject: [PATCH] Corrected a PostgreSQL SELECT statement. (#9460) At least in my Postgresql 9.6.5, the old syntax of capitalized queries doesn't work (Linux).
Running with UTF-8 as standard encoding and the ` notations didn't work either, so removed those. --- pkg/services/sqlstore/migrator/postgres_dialect.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/services/sqlstore/migrator/postgres_dialect.go b/pkg/services/sqlstore/migrator/postgres_dialect.go index 92109efdfab..8de26194411 100644 --- a/pkg/services/sqlstore/migrator/postgres_dialect.go +++ b/pkg/services/sqlstore/migrator/postgres_dialect.go @@ -104,7 +104,7 @@ func (db *Postgres) SqlType(c *Column) string { func (db *Postgres) TableCheckSql(tableName string) (string, []interface{}) { args := []interface{}{"grafana", tableName} - sql := "SELECT `TABLE_NAME` from `INFORMATION_SCHEMA`.`TABLES` WHERE `TABLE_SCHEMA`=? and `TABLE_NAME`=?" + sql := "SELECT table_name FROM information_schema.tables WHERE table_schema=? and table_name=?" return sql, args }