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

Pg_background-1.0 is not compatible yet with PostgreSQL 15 #43

Closed
YuriKulaghin opened this issue Nov 1, 2022 · 4 comments
Closed

Pg_background-1.0 is not compatible yet with PostgreSQL 15 #43

YuriKulaghin opened this issue Nov 1, 2022 · 4 comments

Comments

@YuriKulaghin
Copy link

Hello! With PostgreSQL 15 make gives warnings/errors:

pg_background.c:884:2: warning: implicit declaration of function ‘ProcessCompletedNotifies’
pg_background.c:1022:42: warning: implicit declaration of function ‘pg_analyze_and_rewrite’

I offer following patch:

--- pg_background-1.0/pg_background.c
+++ pg_background-1.1/pg_background.c
@@ -882,5 +882,7 @@
 	disable_timeout(STATEMENT_TIMEOUT, false);
 	CommitTransactionCommand();
+	#if PG_VERSION_NUM < 150000
 	ProcessCompletedNotifies();
+	#endif
    	pgstat_report_activity(STATE_IDLE, sql);
 	pgstat_report_stat(true);
@@ -1019,5 +1021,7 @@
 		 */
 		oldcontext = MemoryContextSwitchTo(parsecontext);
-                #if PG_VERSION_NUM >= 100000
+                #if PG_VERSION_NUM >= 150000
+                        querytree_list = pg_analyze_and_rewrite_fixedparams(parsetree, sql, NULL, 0,NULL);
+		#elif PG_VERSION_NUM >= 100000
                         querytree_list = pg_analyze_and_rewrite(parsetree, sql, NULL, 0,NULL);
                 #else

It works for me, check it for PostgreSQL logic.

@devrimgunduz
Copy link

@vibhorkum ping.

@vibhorkumar123
Copy link

@devrimgunduz Looking into it

@vibhorkumar123
Copy link

Fix has been already included in master branch

@vibhorkum
Copy link
Owner

@devrimgunduz @YuriKulaghin Below is the latest release which has support for PostgreSQL 15
https://github.com/vibhorkum/pg_background/releases/tag/v1.1

Please let me know if you have any questions or if you see any issues with the latest version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants