Skip to content

Commit

Permalink
code adjustment for PostgreSQL v16
Browse files Browse the repository at this point in the history
issues reported at heterodb#653
  • Loading branch information
kaigai committed Nov 19, 2023
1 parent 854189c commit fb87671
Show file tree
Hide file tree
Showing 12 changed files with 523 additions and 742 deletions.
116 changes: 58 additions & 58 deletions src/aggfuncs.c

Large diffs are not rendered by default.

17 changes: 8 additions & 9 deletions src/arrow_fdw.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,11 +189,6 @@ static bool arrow_fdw_enabled; /* GUC */
static bool arrow_fdw_stats_hint_enabled; /* GUC */
static int arrow_metadata_cache_size_kb; /* GUC */

PG_FUNCTION_INFO_V1(pgstrom_arrow_fdw_handler);
PG_FUNCTION_INFO_V1(pgstrom_arrow_fdw_validator);
PG_FUNCTION_INFO_V1(pgstrom_arrow_fdw_import_file);
PG_FUNCTION_INFO_V1(pgstrom_arrow_fdw_precheck_schema);

/* ----------------------------------------------------------------
*
* Apache Arrow <--> PG Types Mapping Routines
Expand Down Expand Up @@ -4227,6 +4222,7 @@ ArrowImportForeignSchema(ImportForeignSchemaStmt *stmt, Oid serverOid)
* However, it is not a reasonable restriction for foreign-table, because
* it does not use heap-format internally.
*/
PG_FUNCTION_INFO_V1(pgstrom_arrow_fdw_import_file);
static void
__insertPgAttributeTuple(Relation pg_attr_rel,
CatalogIndexState pg_attr_index,
Expand Down Expand Up @@ -4291,7 +4287,7 @@ __insertPgAttributeTuple(Relation pg_attr_rel,
heap_freetuple(tup);
}

Datum
PUBLIC_FUNCTION(Datum)
pgstrom_arrow_fdw_import_file(PG_FUNCTION_ARGS)
{
CreateForeignTableStmt stmt;
Expand Down Expand Up @@ -4399,7 +4395,8 @@ pgstrom_arrow_fdw_import_file(PG_FUNCTION_ARGS)
/*
* handler of Arrow_Fdw
*/
Datum
PG_FUNCTION_INFO_V1(pgstrom_arrow_fdw_handler);
PUBLIC_FUNCTION(Datum)
pgstrom_arrow_fdw_handler(PG_FUNCTION_ARGS)
{
PG_RETURN_POINTER(&pgstrom_arrow_fdw_routine);
Expand All @@ -4408,7 +4405,8 @@ pgstrom_arrow_fdw_handler(PG_FUNCTION_ARGS)
/*
* validator of Arrow_Fdw
*/
Datum
PG_FUNCTION_INFO_V1(pgstrom_arrow_fdw_validator);
PUBLIC_FUNCTION(Datum)
pgstrom_arrow_fdw_validator(PG_FUNCTION_ARGS)
{
List *options = untransformRelOptions(PG_GETARG_DATUM(0));
Expand Down Expand Up @@ -4457,7 +4455,8 @@ pgstrom_arrow_fdw_validator(PG_FUNCTION_ARGS)
/*
* pgstrom_arrow_fdw_precheck_schema
*/
Datum
PG_FUNCTION_INFO_V1(pgstrom_arrow_fdw_precheck_schema);
PUBLIC_FUNCTION(Datum)
pgstrom_arrow_fdw_precheck_schema(PG_FUNCTION_ARGS)
{
EventTriggerData *trigdata;
Expand Down
8 changes: 6 additions & 2 deletions src/extra.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
static int gpudirect_driver_kind;
static __thread void *gpudirect_vfs_dma_buffer = NULL;
static __thread size_t gpudirect_vfs_dma_buffer_sz = 0UL;
PG_FUNCTION_INFO_V1(pgstrom_license_query);

/*
* heterodbExtraModuleInfo
Expand Down Expand Up @@ -150,6 +149,7 @@ heterodbValidateDevice(int gpu_device_id,
/*
* pgstrom_license_query
*/
PG_FUNCTION_INFO_V1(pgstrom_license_query);
static char *
__heterodb_license_query(void)
{
Expand All @@ -172,7 +172,7 @@ __heterodb_license_query(void)
goto retry;
}

Datum
PUBLIC_FUNCTION(Datum)
pgstrom_license_query(PG_FUNCTION_ARGS)
{
char *license;
Expand Down Expand Up @@ -864,6 +864,10 @@ pgstrom_init_extra(void)
enum_options[enum_index].val = GPUDIRECT_DRIVER__VFS;
enum_index++;

/* MEMO: Since PGv16, GUC variable must be initialized with the boot
* value to pass assertion checks.
*/
gpudirect_driver_kind = enum_options[0].val;
DefineCustomEnumVariable("pg_strom.gpudirect_driver",
"Choice of GPU-Direct SQL Driver",
NULL,
Expand Down
Loading

0 comments on commit fb87671

Please sign in to comment.