From 420f4834d26ce81f08fef66be4d2b8cd59dcc58c Mon Sep 17 00:00:00 2001 From: Fenny <25108519+Fenny@users.noreply.github.com> Date: Thu, 5 Nov 2020 05:55:18 +0100 Subject: [PATCH] Update postgres.go --- postgres/postgres.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/postgres/postgres.go b/postgres/postgres.go index 64b00368..abbb8d17 100644 --- a/postgres/postgres.go +++ b/postgres/postgres.go @@ -99,7 +99,7 @@ func New(config ...Config) *Storage { db: db, gcInterval: cfg.GCInterval, sqlSelect: fmt.Sprintf(`SELECT data, exp FROM %s WHERE key=$1;`, cfg.Table), - sqlInsert: fmt.Sprintf(`INSERT INTO %s (key, data, exp) VALUES ($1, $2, $3) ON DUPLICATE KEY UPDATE data="$1", exp=$3`, cfg.Table), + sqlInsert: fmt.Sprintf(`INSERT INTO %s (key, data, exp) VALUES ($1, $2, $3)`, cfg.Table), sqlDelete: fmt.Sprintf("DELETE FROM %s WHERE key=$1", cfg.Table), sqlClear: fmt.Sprintf("DELETE FROM %s;", cfg.Table), sqlGC: fmt.Sprintf("DELETE FROM %s WHERE exp <= $1", cfg.Table),