aboutsummaryrefslogtreecommitdiff
path: root/src/datacache/plugin_datacache_postgres.c
diff options
context:
space:
mode:
authorDaniel Golle <daniel@makrotopia.org>2016-10-13 00:29:43 +0000
committerDaniel Golle <daniel@makrotopia.org>2016-10-13 00:29:43 +0000
commit505c2e0638d66e48a44bb52bfd5127f59b8d6353 (patch)
tree36f5e3bcd5e9d3bc7d7a0d4ea6cb787e81dceb2d /src/datacache/plugin_datacache_postgres.c
parent17fe492dd48812f839eee1de813f2c7b906bc907 (diff)
datacache: postgres: use IF NOT EXISTS to avoid error messages
Diffstat (limited to 'src/datacache/plugin_datacache_postgres.c')
-rw-r--r--src/datacache/plugin_datacache_postgres.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/datacache/plugin_datacache_postgres.c b/src/datacache/plugin_datacache_postgres.c
index 147bb42234..13c2c26a27 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);