[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libeufin] branch master updated: -fix issue with multiple dbinit runnin
From: |
gnunet |
Subject: |
[libeufin] branch master updated: -fix issue with multiple dbinit running concurrently |
Date: |
Sun, 27 Aug 2023 14:07:03 +0200 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository libeufin.
The following commit(s) were added to refs/heads/master by this push:
new 534a7d31 -fix issue with multiple dbinit running concurrently
534a7d31 is described below
commit 534a7d316c7febb43e017b7e9917daeb369af71d
Author: Christian Grothoff <grothoff@gnunet.org>
AuthorDate: Sun Aug 27 14:06:59 2023 +0200
-fix issue with multiple dbinit running concurrently
---
database-versioning/versioning.sql | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/database-versioning/versioning.sql
b/database-versioning/versioning.sql
index 98e7f661..c7fa8121 100644
--- a/database-versioning/versioning.sql
+++ b/database-versioning/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.';
@@ -205,7 +210,7 @@ BEGIN
RETURN;
END;
$$ language plpgsql;
-COMMENT ON FUNCTION _v.register_patch( TEXT, TEXT[], TEXT[]) IS 'Function to
register patches in database. Raises exception if there are conflicts,
prerequisites are not installed or the migration has already been installed.';
+COMMENT ON FUNCTION _v.register_patch( TEXT, TEXT[], TEXT[] ) IS 'Function to
register patches in database. Raises exception if there are conflicts,
prerequisites are not installed or the migration has already been installed.';
CREATE OR REPLACE FUNCTION _v.register_patch( TEXT, TEXT[] ) RETURNS setof
INT4 AS $$
SELECT _v.register_patch( $1, $2, NULL );
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [libeufin] branch master updated: -fix issue with multiple dbinit running concurrently,
gnunet <=