Skip to content

Add oids mappings with objects names#359

Merged
andr-sokolov merged 8 commits intoOPENGPDB_STABLEfrom
pgaudit_ast_dict
Mar 6, 2026
Merged

Add oids mappings with objects names#359
andr-sokolov merged 8 commits intoOPENGPDB_STABLEfrom
pgaudit_ast_dict

Conversation

@andr-sokolov
Copy link
Contributor

@andr-sokolov andr-sokolov commented Mar 3, 2026

It is necessary to know names of tables and functions used in a query, but AST
contains oids only. We cannot use the system catalog tables to find out
the names, because tables and functions may have been dropped before the logs
are analysed.

Append oids mappings with names of relations and functions to AST. These
mappings also contain list of columns to get column name by its index.

The nodeToString function is replaced with query_to_text. This new function
finds out relations and functions oids in the Query structure. If they exist,
the function appends records about them to the output of nodeToString.
Otherwise, query_to_text return value is the same as that of nodeToString.

@andr-sokolov andr-sokolov marked this pull request as ready for review March 5, 2026 11:06
@andr-sokolov andr-sokolov merged commit 4775691 into OPENGPDB_STABLE Mar 6, 2026
44 of 45 checks passed
@andr-sokolov andr-sokolov deleted the pgaudit_ast_dict branch March 6, 2026 08:33
andr-sokolov added a commit that referenced this pull request Mar 6, 2026
It is necessary to know names of tables and functions used in a query, but AST
contains oids only. We cannot use the system catalog tables to find out
the names, because tables and functions may have been dropped before the logs
are analysed.

Append oids mappings with names of relations and functions to AST. These
mappings also contain list of columns to get column name by its index.

The nodeToString function is replaced with query_to_text. This new function
finds out relations and functions oids in the Query structure. If they exist,
the function appends records about them to the output of nodeToString.
Otherwise, query_to_text return value is the same as that of nodeToString.
andr-sokolov added a commit that referenced this pull request Mar 6, 2026
It is necessary to know names of tables and functions used in a query, but AST
contains oids only. We cannot use the system catalog tables to find out
the names, because tables and functions may have been dropped before the logs
are analysed.

Append oids mappings with names of relations and functions to AST. These
mappings also contain list of columns to get column name by its index.

The nodeToString function is replaced with query_to_text. This new function
finds out relations and functions oids in the Query structure. If they exist,
the function appends records about them to the output of nodeToString.
Otherwise, query_to_text return value is the same as that of nodeToString.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants