diff --git a/HISTORY.md b/HISTORY.md index 5533056..2550df8 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,4 +1,8 @@ +# 0.4.0 - 2020/7/14 + +- Breaking change: the versioning function is not quoting and escaping the name of the history table. Any name that needs quoting (upper case, special chars) should be provided as parameters already quoted and escaped. + # 0.3.0 - 2020/7/14 - Add parameter to ignore updates without actual changes diff --git a/README.md b/README.md index 2483c42..cb88436 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Temporal Tables -_Version: 0.3.0_ +_Version: 0.4.0_ This is an attempt to rewrite the postgresql [temporal_tables](https://github.com/arkhipov/temporal_tables) extension in PL/pgSQL, without the need for external c extension. @@ -66,6 +66,11 @@ FOR EACH ROW EXECUTE PROCEDURE versioning( ); ``` +A note on the history table name. Previous versions of this extension quoted and escaped it before usage. +Starting version 0.4.0 we are not escaping it anymore and users need to provide the escaped version as a parameter to the trigger. + +This is consistent with the c version, simplifies the extension code and fixes an issue with upper case names that weren't properly supported. + Now test with some data: ```sql diff --git a/versioning_function.sql b/versioning_function.sql index 601090f..6c95930 100644 --- a/versioning_function.sql +++ b/versioning_function.sql @@ -14,7 +14,7 @@ DECLARE holder2 record; pg_version integer; BEGIN - -- version 0.3.0 + -- version 0.4.0 IF TG_WHEN != 'BEFORE' OR TG_LEVEL != 'ROW' THEN RAISE TRIGGER_PROTOCOL_VIOLATED USING diff --git a/versioning_function_nochecks.sql b/versioning_function_nochecks.sql index da9ef46..9577d20 100644 --- a/versioning_function_nochecks.sql +++ b/versioning_function_nochecks.sql @@ -11,7 +11,7 @@ DECLARE transaction_info txid_snapshot; existing_range tstzrange; BEGIN - -- version 0.3.0 + -- version 0.4.0 sys_period := TG_ARGV[0]; history_table := TG_ARGV[1];