gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-exchange] branch master updated: -draft for better sql


From: gnunet
Subject: [taler-exchange] branch master updated: -draft for better sql
Date: Thu, 24 Nov 2022 16:20:10 +0100

This is an automated email from the git hooks/post-receive script.

grothoff pushed a commit to branch master
in repository exchange.

The following commit(s) were added to refs/heads/master by this push:
     new 95149f34 -draft for better sql
95149f34 is described below

commit 95149f345fc1daefd2ea703538e31b1be29fb902
Author: Christian Grothoff <grothoff@gnunet.org>
AuthorDate: Thu Nov 24 16:20:08 2022 +0100

    -draft for better sql
---
 src/exchangedb/common-0002.sql | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/src/exchangedb/common-0002.sql b/src/exchangedb/common-0002.sql
index a9c9cd1f..0f7b1f52 100644
--- a/src/exchangedb/common-0002.sql
+++ b/src/exchangedb/common-0002.sql
@@ -172,3 +172,34 @@ COMMENT ON FUNCTION create_shard_server2
   IS 'Create a shard server on the master
       node with all foreign tables and user mappings';
 
+
+
+--------------------------------
+
+CREATE TABLE IF NOT EXISTS partitioned_tables
+  (name VARCHAR PRIMARY KEY NOT NULL);
+
+INSERT INTO partitioned_tables
+    (name)
+  VALUES
+    ('wire_targets')
+   ,('refunds')
+  ON CONFLICT DO NOTHING;
+
+
+CREATE OR REPLACE FUNCTION drop_default_partitions()
+  RETURNS VOID
+  LANGUAGE plpgsql
+AS $$
+DECLARE
+  tc CURSOR FOR SELECT name FROM partitioned_tables;
+BEGIN
+
+  RAISE NOTICE 'Dropping default table partitions';
+  FOR rec IN tc
+  LOOP
+    EXECUTE FORMAT (
+      'DROP TABLE IF EXISTS %s_default ;'::text,
+    rec.name;
+END  
+$$;

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]