aboutsummaryrefslogtreecommitdiff
path: root/src/datacache
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
parent17fe492dd48812f839eee1de813f2c7b906bc907 (diff)
downloadgnunet-505c2e0638d66e48a44bb52bfd5127f59b8d6353.tar.gz
gnunet-505c2e0638d66e48a44bb52bfd5127f59b8d6353.zip
datacache: postgres: use IF NOT EXISTS to avoid error messages
Diffstat (limited to 'src/datacache')
-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 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)
74 return GNUNET_SYSERR; 74 return GNUNET_SYSERR;
75 ret = 75 ret =
76 PQexec (plugin->dbh, 76 PQexec (plugin->dbh,
77 "CREATE TEMPORARY TABLE gn090dc (" 77 "CREATE TEMPORARY TABLE IF NOT EXISTS gn090dc ("
78 " type INTEGER NOT NULL DEFAULT 0," 78 " type INTEGER NOT NULL DEFAULT 0,"
79 " discard_time BIGINT NOT NULL DEFAULT 0," 79 " discard_time BIGINT NOT NULL DEFAULT 0,"
80 " key BYTEA NOT NULL DEFAULT ''," 80 " key BYTEA NOT NULL DEFAULT '',"
@@ -100,10 +100,10 @@ init_connection (struct Plugin *plugin)
100 { 100 {
101 if ((GNUNET_OK != 101 if ((GNUNET_OK !=
102 GNUNET_POSTGRES_exec (plugin->dbh, 102 GNUNET_POSTGRES_exec (plugin->dbh,
103 "CREATE INDEX idx_key ON gn090dc (key)")) || 103 "CREATE INDEX IF NOT EXISTS idx_key ON gn090dc (key)")) ||
104 (GNUNET_OK != 104 (GNUNET_OK !=
105 GNUNET_POSTGRES_exec (plugin->dbh, 105 GNUNET_POSTGRES_exec (plugin->dbh,
106 "CREATE INDEX idx_dt ON gn090dc (discard_time)"))) 106 "CREATE INDEX IF NOT EXISTS idx_dt ON gn090dc (discard_time)")))
107 { 107 {
108 PQclear (ret); 108 PQclear (ret);
109 PQfinish (plugin->dbh); 109 PQfinish (plugin->dbh);