Files
documentdb/pg_documentdb/sql/schema/background_index_queue--0.14-0.sql
Zinan Ren 4e093b2c9d Merged PR 1545484: [OSS] Porting udfs into documentdb - part 2
### 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

Porting udfs into documentdb

----
#### AI description  (iteration 1)
#### PR Classification
Code cleanup and feature enhancement.

#### PR Summary
This pull request continues the porting of UDFs into DocumentDB, updating and including various SQL files for better functionality and organization.
- Updated `documentdb--0.24-0.sql` to include new UDFs and operators, replacing old function references.
- Added new UDFs for query, projection, geospatial, aggregation, metadata, schema management, index management, CRUD commands, user management, schema validation, telemetry, TTL, vector search, extension version, diagnostic, and RBAC metadata.
- Removed outdated function definitions and replaced them with updated SQL includes.
2025-01-15 07:48:41 +00:00

22 lines
1.3 KiB
SQL

DROP TABLE IF EXISTS __API_CATALOG_SCHEMA_V2__.__EXTENSION_OBJECT_V2__(_index_queue);
CREATE TABLE __API_CATALOG_SCHEMA_V2__.__EXTENSION_OBJECT_V2__(_index_queue)
(
index_cmd text not null,
cmd_type char CHECK (cmd_type IN ('C', 'R')), -- 'C' for CREATE INDEX and 'R' for REINDEX
index_id integer not null,
index_cmd_status integer default 1, -- This gets represented as enum IndexCmdStatus in index.h
global_pid bigint,
start_time timestamp WITH TIME ZONE,
collection_id bigint not null,
comment __CORE_SCHEMA__.bson,
attempt smallint,
update_time timestamp with time zone DEFAULT now(),
user_oid Oid CHECK (user_oid IS NULL OR user_oid != '0'::oid)
);
CREATE INDEX IF NOT EXISTS __EXTENSION_OBJECT_V2__(_index_queue_indexid_cmdtype) on __API_CATALOG_SCHEMA_V2__.__EXTENSION_OBJECT_V2__(_index_queue) (index_id, cmd_type);
CREATE INDEX IF NOT EXISTS __EXTENSION_OBJECT_V2__(_index_queue_cmdtype_collectionid_cmdstatus) on __API_CATALOG_SCHEMA_V2__.__EXTENSION_OBJECT_V2__(_index_queue) (cmd_type, collection_id, index_cmd_status);
GRANT SELECT ON TABLE __API_CATALOG_SCHEMA_V2__.__EXTENSION_OBJECT_V2__(_index_queue) TO public;
GRANT ALL ON TABLE __API_CATALOG_SCHEMA_V2__.__EXTENSION_OBJECT_V2__(_index_queue) TO __API_ADMIN_ROLE__;