Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
4.2.0
=====

NEW FEATURES
------------
- Add PG_MODULE_MAGIC_EXT() macro for PostgreSQL >= 18.
- Remove support for PostgreSQL 12.

4.1.0
=====

Expand Down
2 changes: 1 addition & 1 deletion set_user.control
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# set_user extension
comment = 'similar to SET ROLE but with added logging'
default_version = '4.1.0'
default_version = '4.2.0'
module_pathname = '$libdir/set_user'
relocatable = false
10 changes: 10 additions & 0 deletions src/compatibility.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,16 @@
#define NO_ASSERT_AUTH_UID_ONCE !USE_ASSERT_CHECKING
#endif

/*
* Define PG_MODULE_MAGIC_EXT() as PG_MODULE_MAGIC for versions where the new
* macro does not exist
*/
#if PG_VERSION_NUM < 180000

#define PG_MODULE_MAGIC_EXT(...) PG_MODULE_MAGIC

#endif /* PG_VERSION_NUM < 180000 */

/*
* PostgreSQL version 17+
*
Expand Down
5 changes: 2 additions & 3 deletions src/set_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,10 @@
#include "utils/varlena.h"

#include "set_user.h"

PG_MODULE_MAGIC;

#include "compatibility.h"

PG_MODULE_MAGIC_EXT(.name = "set_user", .version = "4.2.0");

#define ALLOWLIST_WILDCARD "*"
#define SUPERUSER_AUDIT_TAG "AUDIT"

Expand Down
2 changes: 2 additions & 0 deletions updates/set_user--4.1.0--4.2.0.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-- complain if script is sourced in psql, rather than via ALTER EXTENSION
\echo Use "ALTER EXTENSION set_user UPDATE" to load this file. \quit