forked from pgaudit/set_user
-
Notifications
You must be signed in to change notification settings - Fork 0
/
set_user--1.6.sql
44 lines (32 loc) · 1.17 KB
/
set_user--1.6.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
/* set-user--1.6.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 */