From d2ec1bf3cf55f9dc8384a468c7f2bf5efb3db4d8 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Mon, 25 Jul 2022 22:49:59 +0200 Subject: move auditor database also into schema --- src/auditordb/plugin_auditordb_postgres.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'src/auditordb/plugin_auditordb_postgres.c') diff --git a/src/auditordb/plugin_auditordb_postgres.c b/src/auditordb/plugin_auditordb_postgres.c index 8b12474d3..8ddfbee68 100644 --- a/src/auditordb/plugin_auditordb_postgres.c +++ b/src/auditordb/plugin_auditordb_postgres.c @@ -1,6 +1,6 @@ /* This file is part of TALER - Copyright (C) 2014-2021 Taler Systems SA + Copyright (C) 2014-2022 Taler Systems SA TALER is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -128,11 +128,15 @@ postgres_create_tables (void *cls) { struct PostgresClosure *pc = cls; struct GNUNET_PQ_Context *conn; + struct GNUNET_PQ_ExecuteStatement es[] = { + GNUNET_PQ_make_try_execute ("SET search_path TO auditor;"), + GNUNET_PQ_EXECUTE_STATEMENT_END + }; conn = GNUNET_PQ_connect_with_cfg (pc->cfg, "auditordb-postgres", "auditor-", - NULL, + es, NULL); if (NULL == conn) return GNUNET_SYSERR; @@ -685,6 +689,10 @@ setup_connection (struct PostgresClosure *pg) 1), GNUNET_PQ_PREPARED_STATEMENT_END }; + struct GNUNET_PQ_ExecuteStatement es[] = { + GNUNET_PQ_make_try_execute ("SET search_path TO auditor;"), + GNUNET_PQ_EXECUTE_STATEMENT_END + }; struct GNUNET_PQ_Context *db_conn; if (NULL != pg->conn) @@ -695,7 +703,7 @@ setup_connection (struct PostgresClosure *pg) db_conn = GNUNET_PQ_connect_with_cfg (pg->cfg, "auditordb-postgres", NULL, - NULL, + es, ps); if (NULL == db_conn) return GNUNET_SYSERR; @@ -847,12 +855,16 @@ postgres_gc (void *cls) #endif GNUNET_PQ_PREPARED_STATEMENT_END }; + struct GNUNET_PQ_ExecuteStatement es[] = { + GNUNET_PQ_make_try_execute ("SET search_path TO auditor;"), + GNUNET_PQ_EXECUTE_STATEMENT_END + }; now = GNUNET_TIME_absolute_get (); conn = GNUNET_PQ_connect_with_cfg (pg->cfg, "auditordb-postgres", NULL, - NULL, + es, ps); if (NULL == conn) return GNUNET_SYSERR; -- cgit v1.2.3