Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add regression tests #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
42 changes: 42 additions & 0 deletions expected/prioritize.out
Original file line number Diff line number Diff line change
@@ -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)

11 changes: 11 additions & 0 deletions sql/prioritize.sql
Original file line number Diff line number Diff line change
@@ -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);