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

Build failure with PG11: error: too few arguments to function 'BackgroundWorkerInitializeConnection' #226

Closed
df7cb opened this issue Jul 18, 2018 · 5 comments

Comments

@df7cb
Copy link

df7cb commented Jul 18, 2018

Hi,
while trying to get the Debian packages ready for PG11, I noticed pg_partman doesn't support it yet:

13:19:05 gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -g -g -O2 -fdebug-prefix-map=/build/postgresql-11-bbCkV4/postgresql-11-11~beta2=. -fstack-protector-strong -Wformat -Werror=format-security -fno-omit-frame-pointer -fPIC -I. -I./ -I/usr/include/postgresql/11/server -I/usr/include/postgresql/internal  -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2  -I/usr/include/mit-krb5  -c -o src/pg_partman_bgw.o src/pg_partman_bgw.c
13:19:05 src/pg_partman_bgw.c: In function 'pg_partman_bgw_run_maint':
13:19:05 src/pg_partman_bgw.c:398:5: error: too few arguments to function 'BackgroundWorkerInitializeConnection'
13:19:05      BackgroundWorkerInitializeConnection(dbname, pg_partman_bgw_role);
13:19:05      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

A new release with a fix would be welcome. Thanks!

@keithf4
Copy link
Collaborator

keithf4 commented Jul 18, 2018

Yes, I'm aware that some work needs to be done for PG11. I usually wait until there's at least a release candidate to dive into the C code stuff because I've previously run into backend code changes during dev/beta forcing me to have to keep redoing fixes.

Appreciate that you're already working ahead to test things out!

@keithf4
Copy link
Collaborator

keithf4 commented Jul 19, 2018

So this one was actually a pretty easy fix and I'll likely have it included in the next release. I'd still be cautious providing this as a package for PG11 yet.

$ git diff
diff --git a/src/pg_partman_bgw.c b/src/pg_partman_bgw.c
index 9df8cc1..1b1dcfa 100644
--- a/src/pg_partman_bgw.c
+++ b/src/pg_partman_bgw.c
@@ -395,7 +395,14 @@ void pg_partman_bgw_run_maint(Datum arg) {
     }
 
     elog(DEBUG1, "Before run_maint initialize connection for db %s", dbname);
+
+    #if (PG_VERSION_NUM < 110000)
     BackgroundWorkerInitializeConnection(dbname, pg_partman_bgw_role);
+    #endif
+    #if (PG_VERSION_NUM >= 110000)
+    BackgroundWorkerInitializeConnection(dbname, pg_partman_bgw_role, 0);
+    #endif
+    
     elog(DEBUG1, "After run_maint initialize connection for db %s", dbname);
 
     initStringInfo(&buf);

@devrimgunduz
Copy link

Hi @keithf4 ,

When will you release a new package? Beta3 is already out and I started rolling the RPMs.

Thanks!

@keithf4
Copy link
Collaborator

keithf4 commented Aug 22, 2018

I'm actually working on new features for 11, so this fix won't get rolled out until those are ready. Which will probably be a while.

@keithf4
Copy link
Collaborator

keithf4 commented Oct 12, 2018

This has been fixed in version 4.0.0.

@keithf4 keithf4 closed this as completed Nov 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants