gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r38149 - gnunet/src/namestore


From: gnunet
Subject: [GNUnet-SVN] r38149 - gnunet/src/namestore
Date: Thu, 13 Oct 2016 02:29:40 +0200

Author: daniel
Date: 2016-10-13 02:29:39 +0200 (Thu, 13 Oct 2016)
New Revision: 38149

Modified:
   gnunet/src/namestore/plugin_namestore_postgres.c
Log:
namestore: postgres: use IF NOT EXISTS to avoid error messages

Modified: gnunet/src/namestore/plugin_namestore_postgres.c
===================================================================
--- gnunet/src/namestore/plugin_namestore_postgres.c    2016-10-12 23:12:56 UTC 
(rev 38148)
+++ gnunet/src/namestore/plugin_namestore_postgres.c    2016-10-13 00:29:39 UTC 
(rev 38149)
@@ -85,14 +85,14 @@
   /* create indices */
   if ( (GNUNET_OK !=
        GNUNET_POSTGRES_exec (dbh,
-                              "CREATE INDEX ir_pkey_reverse ON ns097records 
(zone_private_key,pkey)")) ||
+                              "CREATE INDEX IF NOT EXISTS ir_pkey_reverse ON 
ns097records (zone_private_key,pkey)")) ||
        (GNUNET_OK !=
        GNUNET_POSTGRES_exec (dbh,
-                              "CREATE INDEX ir_pkey_iter ON ns097records 
(zone_private_key,rvalue)")) ||
+                              "CREATE INDEX IF NOT EXISTS ir_pkey_iter ON 
ns097records (zone_private_key,rvalue)")) ||
        (GNUNET_OK !=
-       GNUNET_POSTGRES_exec (dbh, "CREATE INDEX it_iter ON ns097records 
(rvalue)")) ||
+       GNUNET_POSTGRES_exec (dbh, "CREATE INDEX IF NOT EXISTS it_iter ON 
ns097records (rvalue)")) ||
        (GNUNET_OK !=
-        GNUNET_POSTGRES_exec (dbh, "CREATE INDEX ir_label ON ns097records 
(label)")) )
+        GNUNET_POSTGRES_exec (dbh, "CREATE INDEX IF NOT EXISTS ir_label ON 
ns097records (label)")) )
     LOG (GNUNET_ERROR_TYPE_ERROR,
         _("Failed to create indices\n"));
 }
@@ -122,7 +122,7 @@
   {
     res =
       PQexec (plugin->dbh,
-              "CREATE TEMPORARY TABLE ns097records ("
+              "CREATE TEMPORARY TABLE IF NOT EXISTS ns097records ("
              " zone_private_key BYTEA NOT NULL DEFAULT '',"
              " pkey BYTEA DEFAULT '',"
              " rvalue BYTEA NOT NULL DEFAULT '',"
@@ -135,7 +135,7 @@
   {
     res =
       PQexec (plugin->dbh,
-              "CREATE TABLE ns097records ("
+              "CREATE TABLE IF NOT EXISTS ns097records ("
              " zone_private_key BYTEA NOT NULL DEFAULT '',"
              " pkey BYTEA DEFAULT '',"
              " rvalue BYTEA NOT NULL DEFAULT '',"




reply via email to

[Prev in Thread] Current Thread [Next in Thread]