[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnunet] 02/02: -fix issue with multiple dbinit running concurrently
From: |
gnunet |
Subject: |
[gnunet] 02/02: -fix issue with multiple dbinit running concurrently |
Date: |
Sun, 27 Aug 2023 14:05:49 +0200 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository gnunet.
commit b6bdddad94a47f02b426ba6db2bbf27bcd2b2a2c
Author: Christian Grothoff <grothoff@gnunet.org>
AuthorDate: Sun Aug 27 14:05:42 2023 +0200
-fix issue with multiple dbinit running concurrently
---
src/pq/versioning.sql | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/pq/versioning.sql b/src/pq/versioning.sql
index 116f409b7..c7fa81213 100644
--- a/src/pq/versioning.sql
+++ b/src/pq/versioning.sql
@@ -146,12 +146,17 @@
BEGIN;
+-- Added by Christian Grothoff to support concurrency, see
+--
https://stackoverflow.com/questions/29900845/create-schema-if-not-exists-raises-duplicate-key-error?rq=4
+LOCK TABLE pg_catalog.pg_namespace;
+
+
-- This file adds versioning support to database it will be loaded to.
-- It requires that PL/pgSQL is already loaded - will raise exception
otherwise.
-- All versioning "stuff" (tables, functions) is in "_v" schema.
-- All functions are defined as 'RETURNS SETOF INT4' to be able to make them
to RETURN literally nothing (0 rows).
--- >> RETURNS VOID<< IS similar, but it still outputs "empty line" in psql
when calling.
+-- >> RETURNS VOID<< IS similar, but it still outputs "empty line" in psql
when calling
CREATE SCHEMA IF NOT EXISTS _v;
COMMENT ON SCHEMA _v IS 'Schema for versioning data and functionality.';
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.