aboutsummaryrefslogtreecommitdiff
path: root/src/datastore/plugin_datastore_postgres.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2010-11-06 13:59:07 +0000
committerChristian Grothoff <christian@grothoff.org>2010-11-06 13:59:07 +0000
commita52c8618e6730de2ef885fb1a4c48d4a89d04cc6 (patch)
tree9d696ebaad45df5e159c6cb6937fa6c98d2efe96 /src/datastore/plugin_datastore_postgres.c
parentd5677140ac428578bf6ed8b188c6f1422ad9d91e (diff)
downloadgnunet-a52c8618e6730de2ef885fb1a4c48d4a89d04cc6.tar.gz
gnunet-a52c8618e6730de2ef885fb1a4c48d4a89d04cc6.zip
report config used
Diffstat (limited to 'src/datastore/plugin_datastore_postgres.c')
-rw-r--r--src/datastore/plugin_datastore_postgres.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/datastore/plugin_datastore_postgres.c b/src/datastore/plugin_datastore_postgres.c
index 54cfac3b3..aa92d7620 100644
--- a/src/datastore/plugin_datastore_postgres.c
+++ b/src/datastore/plugin_datastore_postgres.c
@@ -315,22 +315,25 @@ init_connection (struct Plugin *plugin)
315 "CONFIG", 315 "CONFIG",
316 &conninfo); 316 &conninfo);
317 plugin->dbh = PQconnectdb (conninfo == NULL ? "" : conninfo); 317 plugin->dbh = PQconnectdb (conninfo == NULL ? "" : conninfo);
318 GNUNET_free_non_null (conninfo);
319 if (NULL == plugin->dbh) 318 if (NULL == plugin->dbh)
320 { 319 {
321 /* FIXME: warn about out-of-memory? */ 320 /* FIXME: warn about out-of-memory? */
321 GNUNET_free_non_null (conninfo);
322 return GNUNET_SYSERR; 322 return GNUNET_SYSERR;
323 } 323 }
324 if (PQstatus (plugin->dbh) != CONNECTION_OK) 324 if (PQstatus (plugin->dbh) != CONNECTION_OK)
325 { 325 {
326 GNUNET_log_from (GNUNET_ERROR_TYPE_ERROR, 326 GNUNET_log_from (GNUNET_ERROR_TYPE_ERROR,
327 "datastore-postgres", 327 "datastore-postgres",
328 _("Unable to initialize Postgres: %s"), 328 _("Unable to initialize Postgres with configuration `%s': %s"),
329 conninfo,
329 PQerrorMessage (plugin->dbh)); 330 PQerrorMessage (plugin->dbh));
330 PQfinish (plugin->dbh); 331 PQfinish (plugin->dbh);
331 plugin->dbh = NULL; 332 plugin->dbh = NULL;
333 GNUNET_free_non_null (conninfo);
332 return GNUNET_SYSERR; 334 return GNUNET_SYSERR;
333 } 335 }
336 GNUNET_free_non_null (conninfo);
334 ret = PQexec (plugin->dbh, 337 ret = PQexec (plugin->dbh,
335 "CREATE TABLE gn090 (" 338 "CREATE TABLE gn090 ("
336 " type INTEGER NOT NULL DEFAULT 0," 339 " type INTEGER NOT NULL DEFAULT 0,"