foreign_table_exposer icon indicating copy to clipboard operation
foreign_table_exposer copied to clipboard

Fails to build with Postgres 15

Open wearpants opened this issue 1 year ago • 2 comments

Looks like some of the underlying APIs changed signature? I can try taking a crack at this but my C is terrible.

4.537 INFO: saving /tmp/tmpl6s0w6gf/foreign_table_exposer-1.0.0.zip
4.565 INFO: unpacking: /tmp/tmpl6s0w6gf/foreign_table_exposer-1.0.0.zip
4.577 INFO: building extension
4.640 gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wcast-function-type -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -moutline-atomics -g -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I. -I./ -I/usr/include/postgresql/15/server -I/usr/include/postgresql/internal  -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2   -c -o foreign_table_exposer.o foreign_table_exposer.c
5.007 foreign_table_exposer.c: In function ‘_PG_init’:
5.007 foreign_table_exposer.c:61:33: warning: assignment to ‘post_parse_analyze_hook_type’ {aka ‘void (*)(ParseState *, Query *, JumbleState *)’} from incompatible pointer type ‘void (*)(ParseState *, Query *)’ [-Wincompatible-pointer-types]
5.007    61 |         post_parse_analyze_hook = fte_post_parse_analyse;
5.007       |                                 ^
5.007 foreign_table_exposer.c: In function ‘fte_post_parse_analyse’:
5.007 foreign_table_exposer.c:82:17: error: too few arguments to function ‘prev_post_parse_analyze_hook’
5.007    82 |                 prev_post_parse_analyze_hook(pstate, query);
5.007       |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
5.008 foreign_table_exposer.c: In function ‘rewrite_query’:
5.008 foreign_table_exposer.c:144:21: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
5.008   144 |                     PgClassRelKindPos *relkindPos = (PgClassRelKindPos*) palloc(sizeof(PgClassRelKindPos));
5.008       |                     ^~~~~~~~~~~~~~~~~
5.032 gmake: *** [<builtin>: foreign_table_exposer.o] Error 1
5.033 ERROR: command returned 2: gmake PG_CONFIG=/usr/bin/pg_config all

wearpants avatar Dec 07 '23 21:12 wearpants

This issue & PR from another project looks similar:

  • https://github.com/darold/pgtt/issues/14
  • https://github.com/darold/pgtt/pull/15

wearpants avatar Dec 07 '23 21:12 wearpants

@wearpants I fixed it in my fork, https://github.com/alitrack/foreign_table_exposer

alitrack avatar Dec 14 '23 08:12 alitrack