Files
documentdb/internal/pg_documentdb_distributed/src/documentdb_distributed.c
T
Zinan Ren 1f110c4fe3 Merged PR 1542804: [OSS] Move type/operator/schema files from pg_helio_api -> pg_documentdb
### Does this PR have any customer impact?
No
### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc)
Refactoring
### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes)
Yes
### Are you introducing any new config? If yes, do you have tests with and without them being set?
No
### Release Note (Refer [Template](../docs/release_notes/pgmongo_template.md))

### Description

Move type/operator/schema files from pg_helio_api -> pg_documentdb
Except udf files

----
#### AI description  (iteration 1)
#### PR Classification
Code cleanup

#### PR Summary
This pull request moves type, operator, and schema files from the `pg_helio_api` directory to the `pg_documentdb` directory.
- Updated SQL include paths in multiple `pg_helio_api` SQL files to reference `pg_documentdb` directory.
- Modified `pgmongo` SQL files to include paths from `pg_documentdb` instead of `pg_helio_api`.
- Adjusted `validate_helio_extension_state.sh` script to account for new file paths.
- Updated `Makefile` in `pg_helio_api` to include the new directory structure.
- Changed include paths in `pg_documentdb_distributed` and `pg_helio_distributed` C source files to reflect the new directory structure.
2025-01-15 07:48:40 +00:00

59 lines
1.4 KiB
C

/*-------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
*
* src/documentdb_distributed.c
*
* Initialization of the shared library.
*-------------------------------------------------------------------------
*/
#include <postgres.h>
#include <fmgr.h>
#include <miscadmin.h>
#include <bson.h>
#include <utils/guc.h>
#include <access/xact.h>
#include <utils/version_utils.h>
#include "distributed_hooks.h"
#include "documentdb_distributed_init.h"
extern bool SkipDocumentDBLoad;
PG_MODULE_MAGIC;
void _PG_init(void);
void _PG_fini(void);
/*
* _PG_init gets called when the extension is loaded.
*/
void
_PG_init(void)
{
if (SkipDocumentDBLoad)
{
return;
}
if (!process_shared_preload_libraries_in_progress)
{
ereport(ERROR, (errmsg(
"pg_documentdb_distributed can only be loaded via shared_preload_libraries. "
"Add pg_documentdb_distributed to shared_preload_libraries configuration "
"variable in postgresql.conf in coordinator and workers. "
"Note that pg_documentdb_distributed should be placed right after citus and pg_documentdb.")));
}
InitializeDocumentDBDistributedHooks();
InitDocumentDBDistributedConfigurations("documentdb_distributed");
MarkGUCPrefixReserved("documentdb_distributed");
}
/*
* _PG_fini is called before the extension is reloaded.
*/
void
_PG_fini(void)
{ }