Skip to content

Commit

Permalink
Merge pull request #35 from rjuju/pg14
Browse files Browse the repository at this point in the history
Fix compatibility with pg14
  • Loading branch information
vibhorkum authored May 5, 2021
2 parents a2dd83f + 6f12569 commit fb14cf7
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 1 deletion.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ OBJS = pg_background.o

EXTENSION = pg_background
DATA = pg_background--1.0.sql
REGRESS = pg_background

PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
Expand Down
14 changes: 14 additions & 0 deletions expected/pg_background.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
CREATE EXTENSION pg_background;
CREATE TABLE t(id integer);
SELECT * FROM pg_background_result(pg_background_launch('INSERT INTO t SELECT 1')) AS (result TEXT);
result
------------
INSERT 0 1
(1 row)

SELECT * FROM t;
id
----
1
(1 row)

2 changes: 1 addition & 1 deletion pg_background.c
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,7 @@ save_worker_info(pid_t pid, dsm_segment *seg, BackgroundWorkerHandle *handle,
ctl.keysize = sizeof(pid_t);
ctl.entrysize = sizeof(pg_background_worker_info);
worker_hash = hash_create("pg_background worker_hash", 8, &ctl,
HASH_ELEM);
HASH_BLOBS | HASH_ELEM);
}

/* Get current authentication information. */
Expand Down
7 changes: 7 additions & 0 deletions sql/pg_background.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
CREATE EXTENSION pg_background;

CREATE TABLE t(id integer);

SELECT * FROM pg_background_result(pg_background_launch('INSERT INTO t SELECT 1')) AS (result TEXT);

SELECT * FROM t;

0 comments on commit fb14cf7

Please sign in to comment.