aboutsummaryrefslogtreecommitdiff
path: root/src/exchangedb/shard-0001-part.sql
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2022-07-28 22:27:23 +0200
committerChristian Grothoff <christian@grothoff.org>2022-07-28 22:27:23 +0200
commitdc26b2db4cecbca155f5df2678f60aadf13c3bd4 (patch)
treeefd3d15d2ad2109ab17f8181e0af01a210ec0602 /src/exchangedb/shard-0001-part.sql
parent5f1d8fc4065e49c0cb0f1686824339bd5a3f7e15 (diff)
downloadexchange-dc26b2db4cecbca155f5df2678f60aadf13c3bd4.tar.gz
exchange-dc26b2db4cecbca155f5df2678f60aadf13c3bd4.tar.bz2
exchange-dc26b2db4cecbca155f5df2678f60aadf13c3bd4.zip
-ensure single transaction for exchange-0001.sql / shard-0001.sql
Diffstat (limited to 'src/exchangedb/shard-0001-part.sql')
-rw-r--r--src/exchangedb/shard-0001-part.sql156
1 files changed, 0 insertions, 156 deletions
diff --git a/src/exchangedb/shard-0001-part.sql b/src/exchangedb/shard-0001-part.sql
index e642fe65e..629dac537 100644
--- a/src/exchangedb/shard-0001-part.sql
+++ b/src/exchangedb/shard-0001-part.sql
@@ -14,12 +14,6 @@
-- TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
--
--- Everything in one big transaction
-BEGIN;
-
--- Check patch versioning is in place.
-SELECT _v.register_patch('shard-0001', NULL, NULL);
-
CREATE OR REPLACE FUNCTION setup_shard(
shard_idx INTEGER
)
@@ -121,153 +115,3 @@ BEGIN
PERFORM add_constraints_to_wad_in_entries_partition(shard_suffix);
END
$$;
-
-
-CREATE OR REPLACE FUNCTION drop_shard(
- shard_idx INTEGER
-)
- RETURNS VOID
- LANGUAGE plpgsql
-AS $$
-DECLARE
- shard_suffix VARCHAR;
-BEGIN
-
- shard_suffix = shard_idx::varchar;
-
- EXECUTE FORMAT(
- 'DROP TABLE IF EXISTS %I CASCADE'
- ,'wire_targets_' || shard_suffix
- );
- EXECUTE FORMAT(
- 'DROP TABLE IF EXISTS %I CASCADE'
- ,'reserves_' || shard_suffix
- );
- EXECUTE FORMAT(
- 'DROP TABLE IF EXISTS %I CASCADE'
- ,'reserves_in_' || shard_suffix
- );
- EXECUTE FORMAT(
- 'DROP TABLE IF EXISTS %I CASCADE'
- ,'reserves_out_' || shard_suffix
- );
- EXECUTE FORMAT(
- 'DROP TABLE IF EXISTS %I CASCADE'
- ,'reserves_close_' || shard_suffix
- );
- EXECUTE FORMAT(
- 'DROP TABLE IF EXISTS %I CASCADE'
- ,'known_coins_' || shard_suffix
- );
- EXECUTE FORMAT(
- 'DROP TABLE IF EXISTS %I CASCADE'
- ,'refresh_commitments_' || shard_suffix
- );
- EXECUTE FORMAT(
- 'DROP TABLE IF EXISTS %I CASCADE'
- ,'refresh_revealed_coins_' || shard_suffix
- );
- EXECUTE FORMAT(
- 'DROP TABLE IF EXISTS %I CASCADE'
- ,'refresh_transfer_keys_' || shard_suffix
- );
- EXECUTE FORMAT(
- 'DROP TABLE IF EXISTS %I CASCADE'
- ,'deposits_' || shard_suffix
- );
- EXECUTE FORMAT(
- 'DROP TABLE IF EXISTS %I CASCADE'
- ,'deposits_by_ready_' || shard_suffix
- );
- EXECUTE FORMAT(
- 'DROP TABLE IF EXISTS %I CASCADE'
- ,'deposits_for_matching_' || shard_suffix
- );
- EXECUTE FORMAT(
- 'DROP TABLE IF EXISTS %I CASCADE'
- ,'refunds_' || shard_suffix
- );
- EXECUTE FORMAT(
- 'DROP TABLE IF EXISTS %I CASCADE'
- ,'wire_out_' || shard_suffix
- );
- EXECUTE FORMAT(
- 'DROP TABLE IF EXISTS %I CASCADE'
- ,'aggregation_transient_' || shard_suffix
- );
- EXECUTE FORMAT(
- 'DROP TABLE IF EXISTS %I CASCADE'
- ,'aggregation_tracking_' || shard_suffix
- );
- EXECUTE FORMAT(
- 'DROP TABLE IF EXISTS %I CASCADE'
- ,'recoup_' || shard_suffix
- );
- EXECUTE FORMAT(
- 'DROP TABLE IF EXISTS %I CASCADE'
- ,'recoup_by_reserve_' || shard_suffix
- );
- EXECUTE FORMAT(
- 'DROP TABLE IF EXISTS %I CASCADE'
- ,'reserves_out_by_reserve_' || shard_suffix
- );
- EXECUTE FORMAT(
- 'DROP TABLE IF EXISTS %I CASCADE'
- ,'recoup_refresh_' || shard_suffix
- );
- EXECUTE FORMAT(
- 'DROP TABLE IF EXISTS %I CASCADE'
- ,'prewire_' || shard_suffix
- );
- EXECUTE FORMAT(
- 'DROP TABLE IF EXISTS %I CASCADE'
- ,'cs_nonce_locks_' || shard_suffix
- );
- EXECUTE FORMAT(
- 'DROP TABLE IF EXISTS %I CASCADE'
- ,'purse_requests_' || shard_suffix
- );
- EXECUTE FORMAT(
- 'DROP TABLE IF EXISTS %I CASCADE'
- ,'purse_refunds_' || shard_suffix
- );
- EXECUTE FORMAT(
- 'DROP TABLE IF EXISTS %I CASCADE'
- ,'purse_merges_' || shard_suffix
- );
- EXECUTE FORMAT(
- 'DROP TABLE IF EXISTS %I CASCADE'
- ,'account_merges_' || shard_suffix
- );
- EXECUTE FORMAT(
- 'DROP TABLE IF EXISTS %I CASCADE'
- ,'contracts_' || shard_suffix
- );
- EXECUTE FORMAT(
- 'DROP TABLE IF EXISTS %I CASCADE'
- ,'history_requests_' || shard_suffix
- );
- EXECUTE FORMAT(
- 'DROP TABLE IF EXISTS %I CASCADE'
- ,'close_requests_' || shard_suffix
- );
- EXECUTE FORMAT(
- 'DROP TABLE IF EXISTS %I CASCADE'
- ,'purse_deposits_' || shard_suffix
- );
- EXECUTE FORMAT(
- 'DROP TABLE IF EXISTS %I CASCADE'
- ,'wad_out_entries_' || shard_suffix
- );
- EXECUTE FORMAT(
- 'DROP TABLE IF EXISTS %I CASCADE'
- ,'wads_in_' || shard_suffix
- );
- EXECUTE FORMAT(
- 'DROP TABLE IF EXISTS %I CASCADE'
- ,'wad_in_entries_' || shard_suffix
- );
-END
-$$;
-
-COMMIT;