summaryrefslogtreecommitdiff
path: root/src/exchangedb/exchange-0001.sql
diff options
context:
space:
mode:
Diffstat (limited to 'src/exchangedb/exchange-0001.sql')
-rw-r--r--src/exchangedb/exchange-0001.sql31
1 files changed, 15 insertions, 16 deletions
diff --git a/src/exchangedb/exchange-0001.sql b/src/exchangedb/exchange-0001.sql
index 5ce38c286..a4b1c8b9f 100644
--- a/src/exchangedb/exchange-0001.sql
+++ b/src/exchangedb/exchange-0001.sql
@@ -29,9 +29,9 @@ SET search_path TO exchange;
CREATE TABLE exchange_tables
(table_serial_id BIGINT GENERATED BY DEFAULT AS IDENTITY
- ,name VARCHAR NOT NULL
- ,version VARCHAR NOT NULL
- ,action VARCHAR NOT NULL
+ ,name TEXT NOT NULL
+ ,version TEXT NOT NULL
+ ,action TEXT NOT NULL
,partitioned BOOL NOT NULL
,by_range BOOL NOT NULL
,finished BOOL NOT NULL DEFAULT(FALSE));
@@ -42,7 +42,7 @@ COMMENT ON COLUMN exchange_tables.name
COMMENT ON COLUMN exchange_tables.version
IS 'Version of the DB in which the given action happened';
COMMENT ON COLUMN exchange_tables.action
- IS 'Action to take on the table (e.g. create, constrain, foreign, or drop). Create is done for the master table and each partition; constrain is only for partitions or for master if there are no partitions; master only on master (takes no argument); foreign only on master if there are no partitions.';
+ IS 'Action to take on the table (e.g. create, constrain, or foreign). Create is done for the master table and each partition; constrain is only for partitions or for master if there are no partitions; master only on master (takes no argument); foreign only on master if there are no partitions.';
COMMENT ON COLUMN exchange_tables.partitioned
IS 'TRUE if the table is partitioned';
COMMENT ON COLUMN exchange_tables.by_range
@@ -52,10 +52,10 @@ COMMENT ON COLUMN exchange_tables.finished
CREATE FUNCTION create_partitioned_table(
- IN table_definition VARCHAR -- SQL template for table creation
- ,IN table_name VARCHAR -- base name of the table
- ,IN main_table_partition_str VARCHAR -- declaration for how to partition the table
- ,IN partition_suffix VARCHAR DEFAULT NULL -- NULL: no partitioning, 0: yes partitioning, no sharding, >0: sharding
+ IN table_definition TEXT -- SQL template for table creation
+ ,IN table_name TEXT -- base name of the table
+ ,IN main_table_partition_str TEXT -- declaration for how to partition the table
+ ,IN partition_suffix TEXT DEFAULT NULL -- NULL: no partitioning, 0: yes partitioning, no sharding, >0: sharding
)
RETURNS VOID
LANGUAGE plpgsql
@@ -84,9 +84,9 @@ COMMENT ON FUNCTION create_partitioned_table
CREATE FUNCTION comment_partitioned_table(
- IN table_comment VARCHAR
- ,IN table_name VARCHAR
- ,IN partition_suffix VARCHAR DEFAULT NULL
+ IN table_comment TEXT
+ ,IN table_name TEXT
+ ,IN partition_suffix TEXT DEFAULT NULL
)
RETURNS VOID
LANGUAGE plpgsql
@@ -110,10 +110,10 @@ COMMENT ON FUNCTION comment_partitioned_table
CREATE FUNCTION comment_partitioned_column(
- IN table_comment VARCHAR
- ,IN column_name VARCHAR
- ,IN table_name VARCHAR
- ,IN partition_suffix VARCHAR DEFAULT NULL
+ IN table_comment TEXT
+ ,IN column_name TEXT
+ ,IN table_name TEXT
+ ,IN partition_suffix TEXT DEFAULT NULL
)
RETURNS VOID
LANGUAGE plpgsql
@@ -141,7 +141,6 @@ COMMENT ON FUNCTION comment_partitioned_column
-- Main DB setup loop
---------------------------------------------------------------------------
-
CREATE FUNCTION do_create_tables(
num_partitions INTEGER
-- NULL: no partitions, add foreign constraints