aboutsummaryrefslogtreecommitdiff
path: root/src/datastore
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2017-03-09 00:15:45 +0100
committerChristian Grothoff <christian@grothoff.org>2017-03-09 00:15:54 +0100
commit99350928f4087a116de62350d7d3f293e50e468c (patch)
tree84f143effd684bfda4447c11fb256e7ec65d6243 /src/datastore
parent4bf28bcaa25b8da6c28520a1aa18275dbe5f27a4 (diff)
downloadgnunet-99350928f4087a116de62350d7d3f293e50e468c.tar.gz
gnunet-99350928f4087a116de62350d7d3f293e50e468c.zip
we use CREATE INDEX IF NOT EXITS, this requires postgres>=9.6, bump dependency requirements
Diffstat (limited to 'src/datastore')
-rw-r--r--src/datastore/plugin_datastore_postgres.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/datastore/plugin_datastore_postgres.c b/src/datastore/plugin_datastore_postgres.c
index 7b04cc68a..8b8737935 100644
--- a/src/datastore/plugin_datastore_postgres.c
+++ b/src/datastore/plugin_datastore_postgres.c
@@ -114,13 +114,17 @@ init_connection (struct Plugin *plugin)
114 if (PQresultStatus (ret) == PGRES_COMMAND_OK) 114 if (PQresultStatus (ret) == PGRES_COMMAND_OK)
115 { 115 {
116 if ((GNUNET_OK != 116 if ((GNUNET_OK !=
117 GNUNET_POSTGRES_exec (plugin->dbh, "CREATE INDEX IF NOT EXISTS idx_hash ON gn090 (hash)")) || 117 GNUNET_POSTGRES_exec (plugin->dbh,
118 "CREATE INDEX IF NOT EXISTS idx_hash ON gn090 (hash)")) ||
118 (GNUNET_OK != 119 (GNUNET_OK !=
119 GNUNET_POSTGRES_exec (plugin->dbh, "CREATE INDEX IF NOT EXISTS idx_hash_vhash ON gn090 (hash,vhash)")) || 120 GNUNET_POSTGRES_exec (plugin->dbh,
121 "CREATE INDEX IF NOT EXISTS idx_hash_vhash ON gn090 (hash,vhash)")) ||
120 (GNUNET_OK != 122 (GNUNET_OK !=
121 GNUNET_POSTGRES_exec (plugin->dbh, "CREATE INDEX IF NOT EXISTS idx_prio ON gn090 (prio)")) || 123 GNUNET_POSTGRES_exec (plugin->dbh,
124 "CREATE INDEX IF NOT EXISTS idx_prio ON gn090 (prio)")) ||
122 (GNUNET_OK != 125 (GNUNET_OK !=
123 GNUNET_POSTGRES_exec (plugin->dbh, "CREATE INDEX IF NOT EXISTS idx_expire ON gn090 (expire)")) || 126 GNUNET_POSTGRES_exec (plugin->dbh,
127 "CREATE INDEX IF NOT EXISTS idx_expire ON gn090 (expire)")) ||
124 (GNUNET_OK != 128 (GNUNET_OK !=
125 GNUNET_POSTGRES_exec (plugin->dbh, 129 GNUNET_POSTGRES_exec (plugin->dbh,
126 "CREATE INDEX IF NOT EXISTS idx_prio_anon ON gn090 (prio,anonLevel)")) || 130 "CREATE INDEX IF NOT EXISTS idx_prio_anon ON gn090 (prio,anonLevel)")) ||
@@ -128,9 +132,11 @@ init_connection (struct Plugin *plugin)
128 GNUNET_POSTGRES_exec (plugin->dbh, 132 GNUNET_POSTGRES_exec (plugin->dbh,
129 "CREATE INDEX IF NOT EXISTS idx_prio_hash_anon ON gn090 (prio,hash,anonLevel)")) || 133 "CREATE INDEX IF NOT EXISTS idx_prio_hash_anon ON gn090 (prio,hash,anonLevel)")) ||
130 (GNUNET_OK != 134 (GNUNET_OK !=
131 GNUNET_POSTGRES_exec (plugin->dbh, "CREATE INDEX IF NOT EXISTS idx_repl_rvalue ON gn090 (repl,rvalue)")) || 135 GNUNET_POSTGRES_exec (plugin->dbh,
136 "CREATE INDEX IF NOT EXISTS idx_repl_rvalue ON gn090 (repl,rvalue)")) ||
132 (GNUNET_OK != 137 (GNUNET_OK !=
133 GNUNET_POSTGRES_exec (plugin->dbh, "CREATE INDEX IF NOT EXISTS idx_expire_hash ON gn090 (expire,hash)"))) 138 GNUNET_POSTGRES_exec (plugin->dbh,
139 "CREATE INDEX IF NOT EXISTS idx_expire_hash ON gn090 (expire,hash)")))
134 { 140 {
135 PQclear (ret); 141 PQclear (ret);
136 PQfinish (plugin->dbh); 142 PQfinish (plugin->dbh);