diff --git a/Makefile.versions b/Makefile.versions index cfb09a66..3afb214a 100644 --- a/Makefile.versions +++ b/Makefile.versions @@ -2,7 +2,7 @@ GIT_INDEX_DIR=$(shell git rev-parse --git-dir)/index -build/include/metadata/extension_version.h: $(version_file_inputs) $(GIT_INDEX_DIR) +build/include/metadata/$(EXTENSION_OBJECT_PREFIX)_extension_version.h: $(version_file_inputs) $(GIT_INDEX_DIR) mkdir -p build/include/metadata - $(BUILD_SCRIPT_DIR)scripts/generate_extension_version.sh build/include/metadata/extension_version.h $(EXTENSION) $(MODULE_big) || exit 1 + $(BUILD_SCRIPT_DIR)scripts/generate_extension_version.sh build/include/metadata/$(EXTENSION_OBJECT_PREFIX)_extension_version.h $(EXTENSION) $(MODULE_big) || exit 1 diff --git a/internal/pg_documentdb_distributed/documentdb_distributed.control b/internal/pg_documentdb_distributed/documentdb_distributed.control index 0c7474b2..878e13f5 100755 --- a/internal/pg_documentdb_distributed/documentdb_distributed.control +++ b/internal/pg_documentdb_distributed/documentdb_distributed.control @@ -1,5 +1,5 @@ comment = 'Multi-Node API surface for DocumentDB' -default_version = '1.24-0' +default_version = '0.24-0' module_pathname = '$libdir/pg_documentdb_distributed' relocatable = false superuser = true diff --git a/internal/pg_documentdb_distributed/include/helio_distributed_init.h b/internal/pg_documentdb_distributed/include/helio_distributed_init.h index 966325af..920a0675 100644 --- a/internal/pg_documentdb_distributed/include/helio_distributed_init.h +++ b/internal/pg_documentdb_distributed/include/helio_distributed_init.h @@ -10,6 +10,6 @@ #ifndef HELIO_DISTRIBUTED_INIT_H #define HELIO_DISTRIBUTED_INIT_H -void InitHelioDistributedConfigurations(void); +void InitHelioDistributedConfigurations(const char *prefix); #endif diff --git a/internal/pg_documentdb_distributed/sql/documentdb_distributed--1.24-0.sql b/internal/pg_documentdb_distributed/sql/documentdb_distributed--0.24-0.sql similarity index 100% rename from internal/pg_documentdb_distributed/sql/documentdb_distributed--1.24-0.sql rename to internal/pg_documentdb_distributed/sql/documentdb_distributed--0.24-0.sql diff --git a/internal/pg_documentdb_distributed/src/documentdb_distributed.c b/internal/pg_documentdb_distributed/src/documentdb_distributed.c index 8ef010fe..d7faa40a 100644 --- a/internal/pg_documentdb_distributed/src/documentdb_distributed.c +++ b/internal/pg_documentdb_distributed/src/documentdb_distributed.c @@ -45,7 +45,7 @@ _PG_init(void) } InitializeHelioDistributedHooks(); - InitHelioDistributedConfigurations(); + InitHelioDistributedConfigurations("documentdb_distributed"); MarkGUCPrefixReserved("documentdb_distributed"); } diff --git a/internal/pg_documentdb_distributed/src/documentdb_distributed_init.c b/internal/pg_documentdb_distributed/src/documentdb_distributed_init.c index e4632dd8..1539f947 100644 --- a/internal/pg_documentdb_distributed/src/documentdb_distributed_init.c +++ b/internal/pg_documentdb_distributed/src/documentdb_distributed_init.c @@ -31,17 +31,17 @@ bool EnableShardRebalancer = DEFAULT_ENABLE_SHARD_REBALANCER; * Initializes core configurations pertaining to helio core. */ void -InitHelioDistributedConfigurations(void) +InitHelioDistributedConfigurations(const char *prefix) { DefineCustomBoolVariable( - "helio_api_distributed.enable_metadata_reference_table_sync", + psprintf("%s.enable_metadata_reference_table_sync", prefix), gettext_noop( "Determines whether or not to enable metadata reference table syncs."), NULL, &EnableMetadataReferenceTableSync, DEFAULT_ENABLE_METADATA_REFERENCE_SYNC, PGC_USERSET, 0, NULL, NULL, NULL); DefineCustomBoolVariable( - "helio_api_distributed.enable_shard_rebalancer_apis", + psprintf("%s.enable_shard_rebalancer_apis", prefix), gettext_noop( "Determines whether or not to enable shard rebalancer APIs."), NULL, &EnableShardRebalancer, DEFAULT_ENABLE_SHARD_REBALANCER, diff --git a/internal/pg_helio_distributed/src/helio_distributed.c b/internal/pg_helio_distributed/src/helio_distributed.c index f5db1a89..0e21d409 100644 --- a/internal/pg_helio_distributed/src/helio_distributed.c +++ b/internal/pg_helio_distributed/src/helio_distributed.c @@ -45,7 +45,7 @@ _PG_init(void) } InitializeHelioDistributedHooks(); - InitHelioDistributedConfigurations(); + InitHelioDistributedConfigurations("helio_api_distributed"); MarkGUCPrefixReserved("helio_api_distributed"); } diff --git a/pg_documentdb/Makefile b/pg_documentdb/Makefile index 2d0b4b2c..a5a01586 100644 --- a/pg_documentdb/Makefile +++ b/pg_documentdb/Makefile @@ -91,4 +91,4 @@ $(generated_sql_files): build/%: % include $(OSS_SRC_DIR)/Makefile.versions -src/documentdb_extension_version.o : build/include/metadata/extension_version.h \ No newline at end of file +src/documentdb_extension_version.o : build/include/metadata/documentdb_extension_version.h \ No newline at end of file diff --git a/pg_documentdb/documentdb.control b/pg_documentdb/documentdb.control index e3f74225..c90427a0 100644 --- a/pg_documentdb/documentdb.control +++ b/pg_documentdb/documentdb.control @@ -1,5 +1,5 @@ comment = 'API surface for DocumentDB for PostgreSQL' -default_version = '1.24-0' +default_version = '0.24-0' module_pathname = '$libdir/pg_documentdb' relocatable = false superuser = true diff --git a/pg_documentdb/include/helio_api_init.h b/pg_documentdb/include/helio_api_init.h index 44ae0aad..ff070322 100644 --- a/pg_documentdb/include/helio_api_init.h +++ b/pg_documentdb/include/helio_api_init.h @@ -10,9 +10,9 @@ #ifndef HELIO_API_INIT_H #define HELIO_API_INIT_H -void InitApiConfigurations(char *prefix); +void InitApiConfigurations(char *prefix, char *newGucPrefix); void InstallHelioApiPostgresHooks(void); void UninstallHelioApiPostgresHooks(void); -void InitializeHelioBackgroundWorker(char *libraryName); +void InitializeHelioBackgroundWorker(char *libraryName, char *gucPrefix); void InitializeSharedMemoryHooks(void); #endif diff --git a/pg_documentdb/sql/documentdb--1.24-0.sql b/pg_documentdb/sql/documentdb--0.24-0.sql similarity index 100% rename from pg_documentdb/sql/documentdb--1.24-0.sql rename to pg_documentdb/sql/documentdb--0.24-0.sql diff --git a/pg_documentdb/src/documentdb_extension_version.c b/pg_documentdb/src/documentdb_extension_version.c index 4c4ecd44..2dc4cde0 100644 --- a/pg_documentdb/src/documentdb_extension_version.c +++ b/pg_documentdb/src/documentdb_extension_version.c @@ -10,11 +10,11 @@ #include "postgres.h" #include "utils/builtins.h" -#include "metadata/extension_version.h" +#include "metadata/documentdb_extension_version.h" /* exports for SQL callable functions */ -PG_FUNCTION_INFO_V1(get_helio_api_extended_binary_version); -PG_FUNCTION_INFO_V1(get_helio_api_binary_version); +PG_FUNCTION_INFO_V1(get_documentdb_extended_binary_version); +PG_FUNCTION_INFO_V1(get_documentdb_binary_version); /* GIT_VERSION is passed in as a compiler flag during builds that have git installed */ #ifdef GIT_VERSION @@ -26,14 +26,14 @@ PG_FUNCTION_INFO_V1(get_helio_api_binary_version); static const char *ExtensionVersionString = EXTENSION_VERSION_STR GIT_REF; Datum -get_helio_api_extended_binary_version(PG_FUNCTION_ARGS) +get_documentdb_extended_binary_version(PG_FUNCTION_ARGS) { PG_RETURN_TEXT_P(cstring_to_text(ExtensionVersionString)); } Datum -get_helio_api_binary_version(PG_FUNCTION_ARGS) +get_documentdb_binary_version(PG_FUNCTION_ARGS) { PG_RETURN_TEXT_P(cstring_to_text(EXTENSION_VERSION_STR)); } diff --git a/pg_documentdb/src/documentdb_init.c b/pg_documentdb/src/documentdb_init.c index 384698e7..53fdfad5 100644 --- a/pg_documentdb/src/documentdb_init.c +++ b/pg_documentdb/src/documentdb_init.c @@ -66,7 +66,7 @@ bool RecreateRetryTableOnSharding = DEFAULT_RECREATE_RETRY_TABLE_ON_SHARDING; static void HelioTransactionCallback(XactEvent event, void *arg); static void HelioSubTransactionCallback(SubXactEvent event, SubTransactionId mySubid, SubTransactionId parentSubid, void *arg); -static void InitHelioBackgroundWorkerGucs(void); +static void InitHelioBackgroundWorkerGucs(const char *prefix); static void HelioSharedMemoryInit(void); @@ -299,7 +299,7 @@ int MaxUserLimit = MAX_USER_LIMIT; * Initializes core configurations pertaining to the bson type management. */ void -InitApiConfigurations(char *prefix) +InitApiConfigurations(char *prefix, char *newGucPrefix) { DefineCustomStringVariable( psprintf("%s.localhost_connection_string", prefix), @@ -335,7 +335,7 @@ InitApiConfigurations(char *prefix) NULL, NULL, NULL); DefineCustomIntVariable( - "helio_api.next_collection_id", + psprintf("%s.next_collection_id", newGucPrefix), gettext_noop("Set the next collection id to use when creationing a collection."), gettext_noop("Collection ids are normally generated using a sequence. If " "next_collection_id is set to a value different than " @@ -350,7 +350,7 @@ InitApiConfigurations(char *prefix) NULL, NULL, NULL); DefineCustomIntVariable( - "helio_api.next_collection_index_id", + psprintf("%s.next_collection_index_id", newGucPrefix), gettext_noop("Set the next collection index id to use when creating a " "collection index."), gettext_noop("Collection index ids are normally generated using a sequence. " @@ -377,7 +377,7 @@ InitApiConfigurations(char *prefix) NULL, NULL, NULL); DefineCustomBoolVariable( - "helio_api.mongoEnableInQueryOptimization", + psprintf("%s.mongoEnableInQueryOptimization", newGucPrefix), gettext_noop("Determines whether in queries are rewritten to equality"), NULL, &EnableInQueryOptimization, @@ -493,14 +493,14 @@ InitApiConfigurations(char *prefix) DefineCustomBoolVariable( psprintf("%s.enableVectorHNSWIndex", prefix), gettext_noop( - "Enables support for HNSW index type and query for vector search in pg_helio_api."), + "Enables support for HNSW index type and query for vector search in bson documents index."), NULL, &EnableVectorHNSWIndex, DEFAULT_ENABLE_VECTOR_HNSW_INDEX, PGC_USERSET, 0, NULL, NULL, NULL); DefineCustomBoolVariable( psprintf("%s.enableVectorPreFilter", prefix), gettext_noop( - "Enables support for vector pre-filtering feature for vector search in pg_helio_api."), + "Enables support for vector pre-filtering feature for vector search in bson documents index."), NULL, &EnableVectorPreFilter, DEFAULT_ENABLE_VECTOR_PRE_FILTER, PGC_USERSET, 0, NULL, NULL, NULL); @@ -527,7 +527,7 @@ InitApiConfigurations(char *prefix) PGC_USERSET, 0, NULL, NULL, NULL); DefineCustomBoolVariable( - "helio_api.enableGenerateNonExistsTerm", + psprintf("%s.enableGenerateNonExistsTerm", newGucPrefix), gettext_noop( "Enables generating the non exists term for new documents in a collection."), NULL, &EnableGenerateNonExistsTerm, DEFAULT_ENABLE_GENERATE_NON_EXISTS_TERM, @@ -570,14 +570,14 @@ InitApiConfigurations(char *prefix) PGC_USERSET, 0, NULL, NULL, NULL); DefineCustomBoolVariable( - "helio_api.enable_large_unique_index_keys", + psprintf("%s.enable_large_unique_index_keys", newGucPrefix), gettext_noop("Whether or not to enable large index keys on unique indexes."), NULL, &DefaultEnableLargeUniqueIndexKeys, DEFAULT_ENABLE_LARGE_UNIQUE_INDEX_KEYS, PGC_USERSET, 0, NULL, NULL, NULL); /* Deprecated, test only. Do not use in prod. */ DefineCustomBoolVariable( - "helio_api.force_enable_new_unique_opclass", + psprintf("%s.force_enable_new_unique_opclass", newGucPrefix), gettext_noop( "Testing GUC on Whether or not to enable the new opclass for large index keys on unique indexes."), NULL, &ForceEnableNewUniqueOpClass, FORCE_ENABLE_NEW_UNIQUE_OPCLASS, @@ -615,14 +615,14 @@ InitApiConfigurations(char *prefix) PGC_USERSET, 0, NULL, NULL, NULL); DefineCustomBoolVariable( - "helio_api.useLocalExecutionShardQueries", + psprintf("%s.useLocalExecutionShardQueries", newGucPrefix), gettext_noop( "Determines whether or not to push local shard queries to the shard directly."), NULL, &UseLocalExecutionShardQueries, DEFAULT_USE_LOCAL_EXECUTION_SHARD_QUERIES, PGC_USERSET, 0, NULL, NULL, NULL); DefineCustomBoolVariable( - "helio_api.enableNewSelectivityMode", + psprintf("%s.enableNewSelectivityMode", newGucPrefix), gettext_noop( "Determines whether to use the new selectivity logic."), NULL, &EnableNewOperatorSelectivityMode, @@ -630,7 +630,7 @@ InitApiConfigurations(char *prefix) PGC_USERSET, 0, NULL, NULL, NULL); DefineCustomBoolVariable( - "helio_api.enableRumIndexScan", + psprintf("%s.enableRumIndexScan", newGucPrefix), gettext_noop( "Allow rum index scans."), NULL, @@ -641,21 +641,21 @@ InitApiConfigurations(char *prefix) NULL, NULL, NULL); DefineCustomBoolVariable( - "helio_api.enableMergeTargetCreation", + psprintf("%s.enableMergeTargetCreation", newGucPrefix), gettext_noop( "Enables support for target collection creation in pg_helio_api."), NULL, &EnableMergeTargetCreation, DEFAULT_ENABLE_MERGE_TARGET_CREATION, PGC_USERSET, 0, NULL, NULL, NULL); DefineCustomBoolVariable( - "helio_api.enableMergeAcrossDB", + psprintf("%s.enableMergeAcrossDB", newGucPrefix), gettext_noop( "Enables support for merge stage in pg_helio_api."), NULL, &EnableMergeAcrossDB, DEFAULT_ENABLE_MERGE_ACROSS_DB, PGC_USERSET, 0, NULL, NULL, NULL); DefineCustomBoolVariable( - "helio_api.enableCursorsOnAggregationQueryRewrite", + psprintf("%s.enableCursorsOnAggregationQueryRewrite", newGucPrefix), gettext_noop( "Whether or not to add the cursors on aggregation style queries."), NULL, @@ -666,7 +666,7 @@ InitApiConfigurations(char *prefix) NULL, NULL, NULL); DefineCustomIntVariable( - "helio_api.maxWildcardIndexKeySize", + psprintf("%s.maxWildcardIndexKeySize", newGucPrefix), gettext_noop("GUC for the max wildcard index key size."), NULL, &MaxWildcardIndexKeySize, DEFAULT_MAX_WILDCARD_INDEX_KEY_SIZE, 1, INT32_MAX, @@ -708,7 +708,7 @@ InitApiConfigurations(char *prefix) NULL, NULL, NULL); DefineCustomBoolVariable( - "helio_api.enableMultiIndexRumJoin", + psprintf("%s.enableMultiIndexRumJoin", newGucPrefix), gettext_noop( "Whether or not to add the cursors on aggregation style queries."), NULL, @@ -719,7 +719,7 @@ InitApiConfigurations(char *prefix) NULL, NULL, NULL); DefineCustomBoolVariable( - "helio_api.enableHelioBackgroundWorker", + psprintf("%s.enableHelioBackgroundWorker", newGucPrefix), gettext_noop("Enable Helio Background worker."), NULL, &EnableBackgroundWorker, DEFAULT_ENABLE_BG_WORKER, PGC_SUSET, 0, NULL, NULL, NULL); @@ -754,35 +754,35 @@ InitApiConfigurations(char *prefix) PGC_USERSET, 0, NULL, NULL, NULL); DefineCustomBoolVariable( - "helio_api.enableLetSupport", + psprintf("%s.enableLetSupport", newGucPrefix), gettext_noop( "Determines whether to enable support for the let in commands and $lookup"), NULL, &EnableLetSupport, DEFAULT_ENABLE_LET_SUPPORT, PGC_USERSET, 0, NULL, NULL, NULL); DefineCustomBoolVariable( - "helio_api.enableLookupLetSupport", + psprintf("%s.enableLookupLetSupport", newGucPrefix), gettext_noop( "Determines whether to enable support for the let in commands and $lookup"), NULL, &EnableLookupLetSupport, DEFAULT_ENABLE_LOOKUP_LET_SUPPORT, PGC_USERSET, 0, NULL, NULL, NULL); DefineCustomBoolVariable( - "helio_api.enableLookupUnwindOptimization", + psprintf("%s.enableLookupUnwindOptimization", newGucPrefix), gettext_noop( "Determines whether to enable support for the optimizing $unwind with $lookup prefix"), NULL, &EnableLookupUnwindSupport, DEFAULT_ENABLE_LOOKUP_UNWIND_OPTIMIZATION, PGC_USERSET, 0, NULL, NULL, NULL); DefineCustomBoolVariable( - "helio_api.ignoreLetOnQuerySpec", + psprintf("%s.ignoreLetOnQuerySpec", newGucPrefix), gettext_noop( "Determines whether to ignore the spec let in commands and $lookup"), NULL, &IgnoreLetOnQuerySupport, DEFAULT_IGNORE_LET_ON_QUERY, PGC_USERSET, 0, NULL, NULL, NULL); DefineCustomBoolVariable( - "helio_api.enableIndexTermTruncationOnNestedObjects", + psprintf("%s.enableIndexTermTruncationOnNestedObjects", newGucPrefix), gettext_noop( "Determines whether to truncate index terms with nested objects (arrays/objects of arrays/objects)"), NULL, &EnableIndexTermTruncationOnNestedObjects, @@ -790,14 +790,14 @@ InitApiConfigurations(char *prefix) PGC_USERSET, 0, NULL, NULL, NULL); DefineCustomBoolVariable( - "helio_api.skipFailOnCollation", + psprintf("%s.skipFailOnCollation", newGucPrefix), gettext_noop( "Determines whether we can skip failing when collation is specified but collation is not supported"), NULL, &SkipFailOnCollation, DEFAULT_SKIP_FAIL_ON_COLLATION, PGC_USERSET, 0, NULL, NULL, NULL); DefineCustomBoolVariable( - "helio_api.enableLookupIdJoinOptimizationOnCollation", + psprintf("%s.enableLookupIdJoinOptimizationOnCollation", newGucPrefix), gettext_noop( "Determines whether we can perform _id join opetimization on collation. It would be a customer input confiriming that _id does not contain collation aware data types (i.e., UTF8 and DOCUMENT)."), NULL, &EnableLookupIdJoinOptimizationOnCollation, @@ -805,28 +805,28 @@ InitApiConfigurations(char *prefix) PGC_USERSET, 0, NULL, NULL, NULL); DefineCustomBoolVariable( - "helio_api.enableUserCrud", + psprintf("%s.enableUserCrud", newGucPrefix), gettext_noop( "Enables user crud through the data plane."), NULL, &EnableUserCrud, DEFAULT_ENABLE_USER_CRUD, PGC_USERSET, 0, NULL, NULL, NULL); DefineCustomBoolVariable( - "helio_api.enableDensifyStage", + psprintf("%s.enableDensifyStage", newGucPrefix), gettext_noop( "Enables $densify aggregation stage."), NULL, &EnableDensifyStage, DEFAULT_ENABLE_DENSIFY_STAGE, PGC_USERSET, 0, NULL, NULL, NULL); DefineCustomStringVariable( - "helio_api.clusterAdminRole", + psprintf("%s.clusterAdminRole", newGucPrefix), gettext_noop( "The cluster admin role."), NULL, &ClusterAdminRole, DEFAULT_CLUSTER_ADMIN_ROLE, PGC_USERSET, 0, NULL, NULL, NULL); DefineCustomIntVariable( - "helio_api.scramDefaultSaltLen", + psprintf("%s.scramDefaultSaltLen", newGucPrefix), gettext_noop("The default scram salt length."), NULL, &ScramDefaultSaltLen, SCRAM_DEFAULT_SALT_LEN, 1, 64, @@ -835,7 +835,7 @@ InitApiConfigurations(char *prefix) NULL, NULL, NULL); DefineCustomIntVariable( - "helio_api.defaultUniqueIndexKeyhashOverride", + psprintf("%s.defaultUniqueIndexKeyhashOverride", newGucPrefix), gettext_noop( "Do not set this in production. GUC used to force a single keyhash result value for testing hash conflicts on unique indexes that require a runtime recheck."), NULL, &DefaultUniqueIndexKeyhashOverride, @@ -845,14 +845,14 @@ InitApiConfigurations(char *prefix) NULL, NULL, NULL); DefineCustomBoolVariable( - "helio_api.enableShardingOrFilters", + psprintf("%s.enableShardingOrFilters", newGucPrefix), gettext_noop( "Whether to enable OR filter based detection for the shard key."), NULL, &EnableShardingOrFilters, DEFAULT_ENABLE_SHARDING_OR_FILTERS, PGC_USERSET, 0, NULL, NULL, NULL); DefineCustomBoolVariable( - "helio_api.throwDeadlockOnCRUD", + psprintf("%s.throwDeadlockOnCRUD", newGucPrefix), gettext_noop( "Determines whether a deadlock on CRUD operations should be thrown as an exception rather than catching it and writing it to the operation result bson."), NULL, @@ -861,7 +861,7 @@ InitApiConfigurations(char *prefix) PGC_USERSET, 0, NULL, NULL, NULL); DefineCustomIntVariable( - "helio_api.maxUserLimit", + psprintf("%s.maxUserLimit", newGucPrefix), gettext_noop("The default number of users allowed."), NULL, &MaxUserLimit, MAX_USER_LIMIT, 1, 100, @@ -899,10 +899,10 @@ InstallHelioApiPostgresHooks(void) /* Initialized the background worker */ void -InitializeHelioBackgroundWorker(char *libraryName) +InitializeHelioBackgroundWorker(char *libraryName, char *gucPrefix) { /* Initialize GUCs */ - InitHelioBackgroundWorkerGucs(); + InitHelioBackgroundWorkerGucs(gucPrefix); if (!EnableBackgroundWorker) { @@ -1015,10 +1015,10 @@ HelioSubTransactionCallback(SubXactEvent event, SubTransactionId mySubid, static void -InitHelioBackgroundWorkerGucs(void) +InitHelioBackgroundWorkerGucs(const char *prefix) { DefineCustomStringVariable( - "helio_bg_worker.database_name", + psprintf("%s_bg_worker_database_name", prefix), gettext_noop("Database to which background worker will connect."), NULL, &BackgroundWorkerDatabaseName, @@ -1028,7 +1028,7 @@ InitHelioBackgroundWorkerGucs(void) NULL, NULL, NULL); DefineCustomIntVariable( - "helio_bg_worker.latch_timeout", + psprintf("%s.bg_worker_latch_timeout", prefix), gettext_noop("Latch timeout inside main thread of helio_bg worker leader."), NULL, &LatchTimeOutSec, diff --git a/pg_documentdb/src/pg_documentdb.c b/pg_documentdb/src/pg_documentdb.c index bb24c7bc..eb558c63 100644 --- a/pg_documentdb/src/pg_documentdb.c +++ b/pg_documentdb/src/pg_documentdb.c @@ -46,7 +46,7 @@ _PG_init(void) } InstallBsonMemVTables(); - InitApiConfigurations("documentdb"); + InitApiConfigurations("documentdb", "documentdb"); InitializeExtensionExternalConfigs("documentdb"); InitializeSharedMemoryHooks(); MarkGUCPrefixReserved("documentdb"); diff --git a/pg_documentdb_core/documentdb_core.control b/pg_documentdb_core/documentdb_core.control index b3245c80..a9b0b248 100644 --- a/pg_documentdb_core/documentdb_core.control +++ b/pg_documentdb_core/documentdb_core.control @@ -1,5 +1,5 @@ comment = 'Core API surface for DocumentDB on PostgreSQL' -default_version = '1.24-0' +default_version = '0.24-0' module_pathname = '$libdir/pg_documentdb_core' relocatable = false superuser = true diff --git a/pg_documentdb_core/sql/documentdb_core--1.24-0.sql b/pg_documentdb_core/sql/documentdb_core--0.24-0.sql similarity index 100% rename from pg_documentdb_core/sql/documentdb_core--1.24-0.sql rename to pg_documentdb_core/sql/documentdb_core--0.24-0.sql diff --git a/pg_helio_api/Makefile b/pg_helio_api/Makefile index aafa3c03..5e9d9152 100644 --- a/pg_helio_api/Makefile +++ b/pg_helio_api/Makefile @@ -97,4 +97,6 @@ $(generated_sql_files): build/%: % include $(OSS_SRC_DIR)/Makefile.versions -include $(OSS_SRC_DIR)/Makefile.docdb \ No newline at end of file +include $(OSS_SRC_DIR)/Makefile.docdb + +src/helio_api_extension_version.o : build/include/metadata/helio_extension_version.h \ No newline at end of file diff --git a/pg_helio_api/src/helio_api_extension_version.c b/pg_helio_api/src/helio_api_extension_version.c new file mode 100644 index 00000000..06abb0ad --- /dev/null +++ b/pg_helio_api/src/helio_api_extension_version.c @@ -0,0 +1,39 @@ +/*------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * + * src/helio_api_extension_version.c + * + * Implementation of version information for the extension. + * + *------------------------------------------------------------------------- + */ +#include "postgres.h" +#include "utils/builtins.h" + +#include "metadata/helio_extension_version.h" + +/* exports for SQL callable functions */ +PG_FUNCTION_INFO_V1(get_helio_api_extended_binary_version); +PG_FUNCTION_INFO_V1(get_helio_api_binary_version); + +/* GIT_VERSION is passed in as a compiler flag during builds that have git installed */ +#ifdef GIT_VERSION +#define GIT_REF " gitref: " GIT_VERSION +#else +#define GIT_REF +#endif + +static const char *ExtensionVersionString = EXTENSION_VERSION_STR GIT_REF; + +Datum +get_helio_api_extended_binary_version(PG_FUNCTION_ARGS) +{ + PG_RETURN_TEXT_P(cstring_to_text(ExtensionVersionString)); +} + + +Datum +get_helio_api_binary_version(PG_FUNCTION_ARGS) +{ + PG_RETURN_TEXT_P(cstring_to_text(EXTENSION_VERSION_STR)); +} diff --git a/pg_helio_api/src/pg_helio_api.c b/pg_helio_api/src/pg_helio_api.c index e3de7e74..31efb304 100644 --- a/pg_helio_api/src/pg_helio_api.c +++ b/pg_helio_api/src/pg_helio_api.c @@ -48,11 +48,11 @@ _PG_init(void) SkipDocumentDBLoad = true; InstallBsonMemVTables(); - InitApiConfigurations("helio_api"); + InitApiConfigurations("helio_api", "helio_api"); InitializeExtensionExternalConfigs("helio_api"); InitializeSharedMemoryHooks(); MarkGUCPrefixReserved("helio_api"); - InitializeHelioBackgroundWorker("pg_helio_api"); + InitializeHelioBackgroundWorker("pg_helio_api", "helio_api"); InstallHelioApiPostgresHooks();