Closed denoley closed 4 years ago
Severall errors i've fixed via:
For the code like this:
Form_pg_attribute att = tupdesc->attrs[i];
i've change it to like this:
Form_pg_attribute att = TupleDescAttr(tupdesc, i);
But one error still present:
bash-4.2$ make
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -fPIC -I. -I./ -I/usr/pgsql-11/include/server -I/usr/pgsql-11/include/internal -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/include -c -o pg_background.o pg_background.c
pg_background.c: In function ‘pg_background_worker_main’:
pg_background.c:825:82: error: too few arguments to function ‘BackgroundWorkerInitializeConnection’
NameStr(fdata->authenticated_user));
^
In file included from /usr/pgsql-11/include/server/storage/shm_mq.h:16:0,
from /usr/pgsql-11/include/server/libpq/pqmq.h:17,
from pg_background.c:27:
/usr/pgsql-11/include/server/postmaster/bgworker.h:143:13: note: declared here
extern void BackgroundWorkerInitializeConnection(const char *dbname, const char *username, uint32 flags);
^
make: *** [pg_background.o] Error 1
Last error has gone when i have modifed code
BackgroundWorkerInitializeConnection(NameStr(fdata->database),
NameStr(fdata->authenticated_user));
with
BackgroundWorkerInitializeConnection(NameStr(fdata->database),
NameStr(fdata->authenticated_user),
BGWORKER_BYPASS_ALLOWCONN);
because of [> Allow background workers to bypass datallowconn
THis adds a "flags" field to the BackgroundWorkerInitializeConnection() and BackgroundWorkerInitializeConnectionByOid(). For now only one flag, BGWORKER_BYPASS_ALLOWCONN, is defined, which allows the worker to ignore datallowconn. ](https://postgrespro.ru/list/thread-id/2381342)
Fixed. Closing this.
I had errors when I make pg_background with Popstgresql 11: