From 505c2e0638d66e48a44bb52bfd5127f59b8d6353 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Thu, 13 Oct 2016 00:29:43 +0000 Subject: [PATCH] datacache: postgres: use IF NOT EXISTS to avoid error messages --- src/datacache/plugin_datacache_postgres.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/datacache/plugin_datacache_postgres.c b/src/datacache/plugin_datacache_postgres.c index 147bb4223..13c2c26a2 100644 --- a/src/datacache/plugin_datacache_postgres.c +++ b/src/datacache/plugin_datacache_postgres.c @@ -74,7 +74,7 @@ init_connection (struct Plugin *plugin) return GNUNET_SYSERR; ret = PQexec (plugin->dbh, - "CREATE TEMPORARY TABLE gn090dc (" + "CREATE TEMPORARY TABLE IF NOT EXISTS gn090dc (" " type INTEGER NOT NULL DEFAULT 0," " discard_time BIGINT NOT NULL DEFAULT 0," " key BYTEA NOT NULL DEFAULT ''," @@ -100,10 +100,10 @@ init_connection (struct Plugin *plugin) { if ((GNUNET_OK != GNUNET_POSTGRES_exec (plugin->dbh, - "CREATE INDEX idx_key ON gn090dc (key)")) || + "CREATE INDEX IF NOT EXISTS idx_key ON gn090dc (key)")) || (GNUNET_OK != GNUNET_POSTGRES_exec (plugin->dbh, - "CREATE INDEX idx_dt ON gn090dc (discard_time)"))) + "CREATE INDEX IF NOT EXISTS idx_dt ON gn090dc (discard_time)"))) { PQclear (ret); PQfinish (plugin->dbh); -- 2.25.1