Add database transaction wrappers and plan helpers#16
Closed
NikolayS wants to merge 1 commit into
Closed
Conversation
52dbb71 to
34f54b3
Compare
- Add postgres_ai schema for organizing our objects - Move pg_statistic view from public to postgres_ai schema - Add postgres_ai.explain_generic() function (SECURITY DEFINER) for collecting generic query plans with optional HypoPG index testing - Add postgres_ai.table_describe() function (SECURITY DEFINER) for collecting comprehensive table information for LLM analysis: - Table metadata (type, pages, estimated rows) - Column definitions with types, nullability, defaults - Indexes (primary key, unique, regular) - Constraints (FK, unique, check) - Foreign keys referencing this table - Vacuum/analyze statistics - Update search_path to include postgres_ai first - Change transaction model to wrap each step in its own begin/commit instead of grouping non-optional steps in a single transaction - Update verification to check for postgres_ai schema and new functions Relates to: https://gitlab.com/postgres-ai/postgres_ai/-/issues/68
34f54b3 to
45d78a4
Compare
Contributor
Author
|
@cursor review |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Relates to: https://gitlab.com/postgres-ai/postgres_ai/-/issues/68
Note
Adds foundational schema and helpers plus safer initialization flow.
postgres_aischema; movespg_statisticview topostgres_ai.pg_statisticand grantsSELECTpostgres_ai.explain_generic(text, text, text)andpostgres_ai.table_describe(text)withEXECUTEgrantssearch_pathtopostgres_ai, "$user", public, pg_catalogbegin/commit(with rollback on failure), including optional stepsUSAGEonpostgres_ai, presence/privileges onpostgres_ai.pg_statistic, search_path containingpostgres_ai, andEXECUTEon the new functionsWritten by Cursor Bugbot for commit 45d78a4. Configure here.