diff --git a/Makefile b/Makefile index 0594d43..92183ab 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ MODULES = set_user EXTENSION = set_user -DATA = set_user--1.6.sql set_user--1.5--1.6.sql set_user--1.4--1.5.sql set_user--1.1--1.4.sql set_user--1.0--1.1.sql +DATA = set_user--2.0.sql set_user--1.6--2.0.sql set_user--1.5--1.6.sql set_user--1.4--1.5.sql set_user--1.1--1.4.sql set_user--1.0--1.1.sql PGFILEDESC = "set_user - similar to SET ROLE but with added logging" REGRESS = set_user diff --git a/README.md b/README.md index eb48d2f..8d3c575 100644 --- a/README.md +++ b/README.md @@ -705,13 +705,16 @@ OR (0 rows) ``` -## TODO +## NOTES -The following changes/enhancements are contemplated: +### Version 2.0.0 -* Improve regression tests -* Add ability to create dependencies in `shared_preload_libraries` such that - extension order does not matter. +- Use of GUCs with `whitelist` have been deprecated in lieu of a more + appropriate `allowlist`. The last GUC set by `ALTER SYSTEM` will be used on + reload, the first attempt to `SHOW` a deprecated variable will provide a + NOTICE. + +- The extension is now non-relocatable and all functions are schema-qualified. ## Licensing diff --git a/set_user--1.6--2.0.sql b/set_user--1.6--2.0.sql new file mode 100644 index 0000000..0a03887 --- /dev/null +++ b/set_user--1.6--2.0.sql @@ -0,0 +1,6 @@ +/* set-user-1.6--2.0.sql */ + +-- complain if script is sourced in psql, rather than via ALTER EXTENSION +\echo Use "ALTER EXTENSION set_user UPDATE to '2.0'" to load this file. \quit + +-- just bumping our version to 2.0. no new sql function features here, so nothing to do. diff --git a/set_user--2.0.sql b/set_user--2.0.sql new file mode 100644 index 0000000..be9dab4 --- /dev/null +++ b/set_user--2.0.sql @@ -0,0 +1,45 @@ +/* set-user--2.0.sql */ + +SET LOCAL search_path to @extschema@; + +-- complain if script is sourced in psql, rather than via CREATE EXTENSION +\echo Use "CREATE EXTENSION set_user" to load this file. \quit + +CREATE FUNCTION @extschema@.set_user(text) +RETURNS text +AS 'MODULE_PATHNAME', 'set_user' +LANGUAGE C; + +CREATE FUNCTION @extschema@.set_user(text, text) +RETURNS text +AS 'MODULE_PATHNAME', 'set_user' +LANGUAGE C STRICT; + +REVOKE EXECUTE ON FUNCTION @extschema@.set_user(text) FROM PUBLIC; +REVOKE EXECUTE ON FUNCTION @extschema@.set_user(text, text) FROM PUBLIC; + +CREATE FUNCTION @extschema@.reset_user() +RETURNS text +AS 'MODULE_PATHNAME', 'set_user' +LANGUAGE C; + +CREATE FUNCTION @extschema@.reset_user(text) +RETURNS text +AS 'MODULE_PATHNAME', 'set_user' +LANGUAGE C STRICT; + +GRANT EXECUTE ON FUNCTION @extschema@.reset_user() TO PUBLIC; +GRANT EXECUTE ON FUNCTION @extschema@.reset_user(text) TO PUBLIC; + +/* New functions in 1.1 (now 1.4) begin here */ + +CREATE FUNCTION @extschema@.set_user_u(text) +RETURNS text +AS 'MODULE_PATHNAME', 'set_user' +LANGUAGE C STRICT; + +REVOKE EXECUTE ON FUNCTION @extschema@.set_user_u(text) FROM PUBLIC; + +/* No new sql functions for 1.5 */ +/* No new sql functions for 1.6 */ +/* No new sql functions for 2.0 */ diff --git a/set_user.control b/set_user.control index 8e504b2..fa499f8 100644 --- a/set_user.control +++ b/set_user.control @@ -1,5 +1,5 @@ # set_user extension comment = 'similar to SET ROLE but with added logging' -default_version = '1.6' +default_version = '2.0' module_pathname = '$libdir/set_user' relocatable = false