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

test for pg_version 11:16 #10

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
21 changes: 21 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: CI

on:
push:
branches:
- master
- main
pull_request:

jobs:
test:
strategy:
matrix:
pg: [16, 15, 14, 13, 12, 11]
name: 🐘 PostgreSQL ${{ matrix.pg }}
runs-on: ubuntu-latest
container: pgxn/pgxn-tools
steps:
- run: pg-start ${{ matrix.pg }}
- uses: actions/checkout@v2
- run: pg-build-test
22 changes: 15 additions & 7 deletions test/expected/parallel_test.out
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
BEGIN;
SET max_parallel_workers_per_gather=4;
SET force_parallel_mode=on;
DO $$
BEGIN
IF current_setting('server_version_num')::int >= 160000 THEN
EXECUTE 'SET debug_parallel_query = on';
ELSE
EXECUTE 'SET force_parallel_mode = on';
END IF;
END $$;
CREATE TABLE parallel_test(i int, c language) WITH (parallel_workers = 4);
INSERT INTO parallel_test (i, c)
SELECT i, c.country
Expand All @@ -21,8 +28,9 @@ SELECT COUNT(*) FROM parallel_test WHERE c = 'id'::language;
-> Partial Aggregate
Output: PARTIAL count(*)
-> Parallel Seq Scan on public.parallel_test
Output: i, c
Filter: (parallel_test.c = 'id'::language)
(9 rows)
(10 rows)

EXPLAIN (costs off,verbose)
SELECT c, COUNT(*) FROM parallel_test GROUP BY 1;
Expand All @@ -31,17 +39,17 @@ SELECT c, COUNT(*) FROM parallel_test GROUP BY 1;
Finalize GroupAggregate
Output: c, count(*)
Group Key: parallel_test.c
-> Sort
-> Gather Merge
Output: c, (PARTIAL count(*))
Sort Key: parallel_test.c
-> Gather
Workers Planned: 4
-> Sort
Output: c, (PARTIAL count(*))
Workers Planned: 4
Sort Key: parallel_test.c
-> Partial HashAggregate
Output: c, PARTIAL count(*)
Group Key: parallel_test.c
-> Parallel Seq Scan on public.parallel_test
Output: c
Output: i, c
(14 rows)

ROLLBACK;
10 changes: 8 additions & 2 deletions test/sql/parallel_test.sql
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
BEGIN;
SET max_parallel_workers_per_gather=4;
SET force_parallel_mode=on;

DO $$
BEGIN
IF current_setting('server_version_num')::int >= 160000 THEN
EXECUTE 'SET debug_parallel_query = on';
ELSE
EXECUTE 'SET force_parallel_mode = on';
END IF;
END $$;
CREATE TABLE parallel_test(i int, c language) WITH (parallel_workers = 4);
INSERT INTO parallel_test (i, c)
SELECT i, c.country
Expand Down
Loading