forked from pgaudit/set_user
-
Notifications
You must be signed in to change notification settings - Fork 0
/
set_user--3.0.sql
53 lines (39 loc) · 1.44 KB
/
set_user--3.0.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/* set-user--3.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 */
/* New functions in 3.0 begin here */
CREATE FUNCTION @extschema@.set_session_auth(text)
RETURNS text
AS 'MODULE_PATHNAME', 'set_session_auth'
LANGUAGE C STRICT;
REVOKE EXECUTE ON FUNCTION @extschema@.set_session_auth(text) FROM PUBLIC;