pgsql: meson: Add basic PGXS compatibility

2022-12-06 Thread Andres Freund
meson: Add basic PGXS compatibility Generate a Makefile.global that's complete enough for PGXS to work for some extensions. It is likely that this compatibility layer will not suffice for every extension and not all platforms - we can expand it over time. This allows extensions to use a single

pgsql: autoconf: Move export_dynamic determination to configure

2022-12-06 Thread Andres Freund
autoconf: Move export_dynamic determination to configure Previously export_dynamic was set in src/makefiles/Makefile.$port. For solaris this required exporting with_gnu_ld. The determination of with_gnu_ld would be nontrivial to copy for meson PGXS compatibility. It's also nice to delete

pgsql: Generate pg_stat_get*() functions for databases using macros

2022-12-06 Thread Michael Paquier
Generate pg_stat_get*() functions for databases using macros The same code pattern is repeated 21 times for int64 counters (0 for missing entry) and 5 times for doubles (0 for missing entry) on database entries. This code is switched to use macros for the basic code instead, shaving a few

pgsql: meson: Basic cygwin support

2022-12-06 Thread Andres Freund
meson: Basic cygwin support There likely are further issues, but as evidenced by the CI task proposed by Justin in the referenced thread, this suffices to build and run basic tests in cygwin (some fixes for the test infrastructure are needed, but that's independent of the meson aspect). Author:

pgsql: Rework query relation permission checking

2022-12-06 Thread Alvaro Herrera
Rework query relation permission checking Currently, information about the permissions to be checked on relations mentioned in a query is stored in their range table entries. So the executor must scan the entire range table looking for relations that need to have permissions checked. This can

pgsql: Fix typo

2022-12-06 Thread Alvaro Herrera
Fix typo Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/b5bbaf08ed8bbc45d396c3383fc89331c914b857 Modified Files -- contrib/sepgsql/dml.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

pgsql: Fix 32-bit build dangling pointer issue in WindowAgg

2022-12-06 Thread David Rowley
Fix 32-bit build dangling pointer issue in WindowAgg 9d9c02ccd added window "run conditions", which allows the evaluation of monotonic window functions to be skipped when the run condition is no longer true. Prior to this commit, once the run condition was no longer true and we stopped

pgsql: Fix 32-bit build dangling pointer issue in WindowAgg

2022-12-06 Thread David Rowley
Fix 32-bit build dangling pointer issue in WindowAgg 9d9c02ccd added window "run conditions", which allows the evaluation of monotonic window functions to be skipped when the run condition is no longer true. Prior to this commit, once the run condition was no longer true and we stopped