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

fix extension compilation error for PG16 #14

Merged
merged 3 commits into from
Jul 31, 2024
Merged

fix extension compilation error for PG16 #14

merged 3 commits into from
Jul 31, 2024

Conversation

ridvankorkmaz
Copy link
Contributor

@ridvankorkmaz ridvankorkmaz commented Jul 30, 2024

There is a compilation problem for any extension generated by this template when extension is compiled for PostgreSQL 16.
At least following repositories are not compiled for PostgreSQL 16 and needed code change.
This PR corrects the error. See relevant ticket DB-983 for error details.

F.Y.I @adjust/database-team @adjust/kpis-team

pg-ad_revenue_source
pg-match_type
pg-purchase_verification_status
pg-rejected_engagement_type
pg-sk_coarse_conversion_value
pg-sk_condition_type
pg-subscription_event_type
pg-unverified_install_reason
wltree

@ridvankorkmaz ridvankorkmaz requested review from za-arthur and a team July 30, 2024 12:40
@levakin
Copy link

levakin commented Jul 30, 2024

@ridvankorkmaz I've also noticed that these 2 extensions are also incompatible with PG 16: pg-os_name, wltree

e.g.

1.785 In file included from src/os_name.h:5,
1.785                  from src/os_name_v0_0.c:1:
1.785 src/os_name_v0_0.c: In function 'os_name_get_list':
1.785 src/os_name_v0_0.c:209:31: warning: passing argument 1 of 'PointerGetDatum' makes pointer from integer without a cast [-Wint-conversion]
1.785   209 |         PG_RETURN_ARRAYTYPE_P(makeArrayResult(astate, CurrentMemoryContext));
1.785       |                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1.785       |                               |
1.785       |                               Datum {aka long unsigned int}
1.785 /usr/local/include/postgresql/server/fmgr.h:361:53: note: in definition of macro 'PG_RETURN_POINTER'
1.785   361 | #define PG_RETURN_POINTER(x) return PointerGetDatum(x)
...

wltree

1.581 ltree_io.c: In function 'ltree_in':
1.581 ltree_io.c:179:9: warning: implicit declaration of function 'SET_VARSIZE' [-Wimplicit-function-declaration]
1.581   179 |         SET_VARSIZE(result, LTREE_HDRSIZE + totallen);
1.581       |         ^~~~~~~~~~~
1.581 In file included from ltree.h:6,
1.581                  from ltree_io.c:10:
1.581 ltree_io.c: In function 'ltree_out':
1.581 /usr/local/include/postgresql/server/fmgr.h:241:9: warning: passing argument 1 of 'DatumGetPointer' makes integer from pointer without a cast [-Wint-conversion]
1.581   241 |         pg_detoast_datum((struct varlena *) DatumGetPointer(datum))
1.581       |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1.581       |         |
1.581       |         struct varlena *
1.581 ltree.h:172:58: note: in expansion of macro 'PG_DETOAST_DATUM'
1.581   172 | #define PG_GETARG_LTREE(x)      ((ltree*)DatumGetPointer(PG_DETOAST_DATUM(PG_GETARG_DATUM(x))))
...

@PerikAdjust
Copy link

For wltree, I started to work on it adjust/wltree#27
but I'm stuck with something and I didn't find the time right now to fix it.

@ridvankorkmaz
Copy link
Contributor Author

@levakin Thanks for contribution,
wltree have different kind of problem (this PR does not cover but we have solution for this as well, @PerikAdjust mentioned), I update list with adding wltree

@levakin
Copy link

levakin commented Jul 30, 2024

@ridvankorkmaz does pg-os_name have the same issue? It's not in the list.

@ridvankorkmaz
Copy link
Contributor Author

@ridvankorkmaz does pg-os_name have the same issue? It's not in the list.

Yes, I updated the list with wltree

@ridvankorkmaz
Copy link
Contributor Author

Merging this, and I will create ticket in for KPIS

@ridvankorkmaz ridvankorkmaz merged commit f82ef67 into main Jul 31, 2024
@ridvankorkmaz ridvankorkmaz deleted the DB-983 branch July 31, 2024 08:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants