Updated on 2025-10-23 GMT+08:00

Security Functions

  • pg_query_audit()

    Description: Views audit logs of the primary database node.

    In the multi-tenancy scenario, global audit logs are returned if this function is called in a non-PDB, and audit logs related to a PDB are returned if this function is called in the PDB.

    Return type: record

    The following table describes return columns.

    Name

    Type

    Description

    time

    timestamp with time zone

    Operation time.

    type

    text

    Operation type.

    result

    text

    Operation result.

    userid

    oid

    User ID.

    username

    text

    Name of the user who performs the operation.

    database

    text

    Database name.

    client_conninfo

    text

    Client connection information.

    object_name

    text

    Object name.

    detail_info

    text

    Operation details.

    node_name

    text

    Node name.

    thread_id

    text

    Thread ID.

    local_port

    text

    Local port.

    remote_port

    text

    Remote port.

  • pg_delete_audit()

    Description: Deletes audit logs in a specified period. In the multi-tenancy scenario, global audit logs in a specified period can be deleted when this function is called in a non-PDB, and audit logs related to a PDB in a specified period can be deleted when this function is called in the PDB.

    Return type: void