Package: postgresql-prioritize / 1.0.4-1.3

regress Patch series | download
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
--- /dev/null
+++ b/expected/prioritize.out
@@ -0,0 +1,42 @@
+CREATE EXTENSION prioritize;
+SELECT get_backend_priority(pg_backend_pid());
+ get_backend_priority 
+----------------------
+                    0
+(1 row)
+
+SELECT set_backend_priority(pg_backend_pid(), -5);
+WARNING:  setpriority(): permission denied
+ set_backend_priority 
+----------------------
+ f
+(1 row)
+
+SET client_min_messages = warning;
+SELECT set_backend_priority(pg_backend_pid(), 5);
+ set_backend_priority 
+----------------------
+ t
+(1 row)
+
+RESET client_min_messages;
+SELECT get_backend_priority(pg_backend_pid());
+ get_backend_priority 
+----------------------
+                    5
+(1 row)
+
+SELECT get_backend_priority(1);
+WARNING:  PID 1 is not a PostgreSQL server process
+ get_backend_priority 
+----------------------
+                     
+(1 row)
+
+SELECT set_backend_priority(1, 5);
+WARNING:  PID 1 is not a PostgreSQL server process
+ set_backend_priority 
+----------------------
+ f
+(1 row)
+
--- /dev/null
+++ b/sql/prioritize.sql
@@ -0,0 +1,11 @@
+CREATE EXTENSION prioritize;
+
+SELECT get_backend_priority(pg_backend_pid());
+SELECT set_backend_priority(pg_backend_pid(), -5);
+SET client_min_messages = warning;
+SELECT set_backend_priority(pg_backend_pid(), 5);
+RESET client_min_messages;
+SELECT get_backend_priority(pg_backend_pid());
+
+SELECT get_backend_priority(1);
+SELECT set_backend_priority(1, 5);
--- a/Makefile
+++ b/Makefile
@@ -9,7 +9,6 @@ DOCS = README.md
 REGRESS = $(MODULES)
 
 SQL_IN = $(MODULES).sql.in
-EXTRA_CLEAN = sql/$(MODULES).sql expected/$(MODULES).out
 
 USE_EXTENSION = $(shell pg_config --version | grep -qE " 8\.|9\.0" && echo no || echo yes)