From 12f0658daf3051b768672eab120ef6cdbfbe4164 Mon Sep 17 00:00:00 2001 From: "Anton A. Melnikov" Date: Thu, 26 Sep 2024 12:52:59 +0300 Subject: [PATCH 1/5] PGPRO-10866: Add static decoration to avoid error: "no previous extern declaration for non-static variable [-Wmissing-variable-declarations]" Tags: vops --- vops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vops.c b/vops.c index 8f3952d..0722b6d 100644 --- a/vops.c +++ b/vops.c @@ -2772,7 +2772,7 @@ vops_last_combine(PG_FUNCTION_ARGS) } -const size_t vops_sizeof[] = +static const size_t vops_sizeof[] = { sizeof(vops_bool), sizeof(vops_char), From bc43f499b4c1fc4f93f53300ee44cdc6e67ebeb3 Mon Sep 17 00:00:00 2001 From: "Anton A. Melnikov" Date: Thu, 26 Sep 2024 12:58:31 +0300 Subject: [PATCH 2/5] PGPRO-10866: Update create_foreignscan_path() calls. Caused by: - e22253467942fdb100087787c3e1e3a8620c54b2 (PostgreSQL) Treat number of disabled nodes in a path as a separate cost metric. - a9375a9e79f8115dc3b2ee9045fb656ebe271b6c (Postgres Pro Enterprise) [PGPRO-5825]: Port contrib/in_memory to EE15 Tags: vops --- vops_fdw.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/vops_fdw.c b/vops_fdw.c index e84e790..ce0f11f 100644 --- a/vops_fdw.c +++ b/vops_fdw.c @@ -438,6 +438,7 @@ postgresGetForeignPaths(PlannerInfo *root, baserel, NULL, /* default pathtarget */ fpinfo->rows, + 0, fpinfo->startup_cost, fpinfo->total_cost, NIL, /* no pathkeys */ @@ -1408,6 +1409,7 @@ add_foreign_grouping_paths(PlannerInfo *root, RelOptInfo *input_rel, grouped_rel, grouped_rel->reltarget, rows, + 0, startup_cost, total_cost, NIL, /* no pathkeys */ From 0c6040dad898d404eecc4e7bb46b1d8e22af1e84 Mon Sep 17 00:00:00 2001 From: Zharkov Roman Date: Mon, 10 Feb 2025 12:05:51 +0700 Subject: [PATCH 3/5] Add meson.build file to support building from the contrib source tree. --- meson.build | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 meson.build diff --git a/meson.build b/meson.build new file mode 100644 index 0000000..ab552ad --- /dev/null +++ b/meson.build @@ -0,0 +1,42 @@ +# Copyright (c) 2025, Postgres Professional + +# Does not support the PGXS infrastructure at this time. Please, compile as part +# of the contrib source tree. + +vops_sources = files( + 'deparse.c', + 'vops.c', + 'vops_fdw.c', +) + +if host_system == 'windows' + vops_sources += rc_lib_gen.process(win32ver_rc, extra_args: [ + '--NAME', '_int', + '--FILEDESC', 'VOPS - vectorized operations for PostgreSQL',]) +endif + +vops = shared_module('vops', + vops_sources, + kwargs: contrib_mod_args + { + 'dependencies': contrib_mod_args['dependencies'] + [libpq], + }, +) +contrib_targets += vops + +install_data( + 'vops.control', + 'vops--1.0--1.1.sql', + 'vops--1.1.sql', + kwargs: contrib_data_args, +) + +tests += { + 'name': 'vops', + 'sd': meson.current_source_dir(), + 'bd': meson.current_build_dir(), + 'regress': { + 'sql': [ + 'test', + ], + }, +} From 50e2b137930f8d198b0b62e790ab86ee6c83cacd Mon Sep 17 00:00:00 2001 From: Karina Litskevich Date: Fri, 5 Sep 2025 16:13:14 +0300 Subject: [PATCH 4/5] [PGPRO-14916] Revert "PGPRO-10866: Update create_foreignscan_path() calls." This reverts commit bc43f499b4c1fc4f93f53300ee44cdc6e67ebeb3, which was wrong and broke compilation with versions 17- Tags: vops --- vops_fdw.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/vops_fdw.c b/vops_fdw.c index ce0f11f..e84e790 100644 --- a/vops_fdw.c +++ b/vops_fdw.c @@ -438,7 +438,6 @@ postgresGetForeignPaths(PlannerInfo *root, baserel, NULL, /* default pathtarget */ fpinfo->rows, - 0, fpinfo->startup_cost, fpinfo->total_cost, NIL, /* no pathkeys */ @@ -1409,7 +1408,6 @@ add_foreign_grouping_paths(PlannerInfo *root, RelOptInfo *input_rel, grouped_rel, grouped_rel->reltarget, rows, - 0, startup_cost, total_cost, NIL, /* no pathkeys */ From 939aa7e94d9ba3faa01c79bd5ac5834f5e17eda4 Mon Sep 17 00:00:00 2001 From: Karina Litskevich Date: Fri, 5 Sep 2025 16:36:21 +0300 Subject: [PATCH 5/5] [PGPRO-14916] Update create_foreignscan_path() and create_foreign_upper_path() calls. Caused by 9e9931d2 (postgres) "Re-allow FDWs and custom scan providers to replace joins with pseudoconstant quals." This is a fix from 9dd4c1e8 (vops), which fixes vops to work with version 17. This fix is improved to take into account that vops should keep working with versions 16-. Also add some cosmetic changes in comments. Tags: vops --- vops_fdw.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/vops_fdw.c b/vops_fdw.c index e84e790..187fade 100644 --- a/vops_fdw.c +++ b/vops_fdw.c @@ -440,9 +440,12 @@ postgresGetForeignPaths(PlannerInfo *root, fpinfo->rows, fpinfo->startup_cost, fpinfo->total_cost, - NIL, /* no pathkeys */ + NIL, /* no pathkeys */ NULL, /* no outer rel either */ NULL, /* no extra plan */ +#if PG_VERSION_NUM>=170000 + NIL, /* no fdw_restrictinfo list */ +#endif NIL); /* no fdw_private list */ add_path(baserel, (Path *) path); } @@ -1411,8 +1414,11 @@ add_foreign_grouping_paths(PlannerInfo *root, RelOptInfo *input_rel, startup_cost, total_cost, NIL, /* no pathkeys */ - NULL, - NIL); /* no fdw_private */ + NULL, /* no extra plan */ +#if PG_VERSION_NUM>=170000 + NIL, /* no fdw_restrictinfo list */ +#endif + NIL); /* no fdw_private list */ #else grouppath = create_foreignscan_path(root, grouped_rel, @@ -1422,8 +1428,11 @@ add_foreign_grouping_paths(PlannerInfo *root, RelOptInfo *input_rel, total_cost, NIL, /* no pathkeys */ grouped_rel->lateral_relids, - NULL, - NIL); /* no fdw_private */ + NULL, /* no extra plan */ +#if PG_VERSION_NUM>=170000 + NIL, /* no fdw_restrictinfo list */ +#endif + NIL); /* no fdw_private list */ #endif /* Add generated path into grouped_rel by add_path(). */