diff options
author | Christian Grothoff <christian@grothoff.org> | 2018-04-11 12:19:55 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2018-04-11 12:19:55 +0200 |
commit | 38c918ff27e5a90c1a17f3989a78c7fca564c47a (patch) | |
tree | 926616f78b59fc0fa3d5e6e643f787f4a9fdcb2f /src/namestore/plugin_namestore_postgres.c | |
parent | 7fe5d70497352ea453289fc582089ac1c352204a (diff) |
support async commit
Diffstat (limited to 'src/namestore/plugin_namestore_postgres.c')
-rw-r--r-- | src/namestore/plugin_namestore_postgres.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/namestore/plugin_namestore_postgres.c b/src/namestore/plugin_namestore_postgres.c index 872bf75cb6..4828cb190d 100644 --- a/src/namestore/plugin_namestore_postgres.c +++ b/src/namestore/plugin_namestore_postgres.c @@ -93,6 +93,25 @@ database_setup (struct Plugin *plugin) if (GNUNET_YES == GNUNET_CONFIGURATION_get_value_yesno (plugin->cfg, "namestore-postgres", + "ASYNC_COMMIT")) + { + struct GNUNET_PQ_ExecuteStatement es[] = { + GNUNET_PQ_make_try_execute ("SET synchronous_commit TO off"), + GNUNET_PQ_EXECUTE_STATEMENT_END + }; + + if (GNUNET_OK != + GNUNET_PQ_exec_statements (plugin->dbh, + es)) + { + PQfinish (plugin->dbh); + plugin->dbh = NULL; + return GNUNET_SYSERR; + } + } + if (GNUNET_YES == + GNUNET_CONFIGURATION_get_value_yesno (plugin->cfg, + "namestore-postgres", "TEMPORARY_TABLE")) { cr = &es_temporary; |