Other Functions

  • pgxc_pool_check()

    Description: Checks whether the connection data buffered in the pool is consistent with pgxc_node.

    Return type: Boolean

  • pgxc_pool_reload()

    Description: Updates the connection information buffered in the pool.

    Return type: Boolean

  • pgxc_lock_for_backup()

    Description: Locks openGauss for taking backup that would be used for restoration on the new nodes.

    Return type: Boolean

  • plan_seed()

    Description: Obtains the seed value of the previous query statement (internal use).

    Return type: int

  • pg_stat_get_env()

    Description: Obtains the environment variable information about the current node.

    Return type: record

  • pg_stat_get_thread()

    Description: Provides information about the status of all threads under the current node.

    Return type: record

  • pg_stat_get_sql_count()

    Description: Provides the counts of the SELECT, UPDATE, INSERT, DELETE, and MERGE INTO statements executed on the current node.

    Return type: record

  • copy_error_log_create()

    Description: Creates the error table (public.pgxc_copy_error_log) required for creating the COPY FROM error tolerance mechanism.

    Return type: Boolean

    NOTE:

    • This function attempts to create the public.pgxc_copy_error_log table. For details about the table, see Table 1.
    • Create the B-tree index on the relname column and execute REVOKE ALL on public.pgxc_copy_error_log FROM public to manage permissions for the error table (the permissions are the same as those of the COPY statement).
    • public.pgxc_copy_error_log is a row-store table. Therefore, this function can be executed and COPY error tolerance is available only when row-store tables can be created in openGauss. Row-store tables cannot be created in openGauss if enable_hadoop_env is set to on. (By default, this parameter is set to off in openGauss.)
    • Same as the error table and the COPY statement, the function requires sysadmin or higher permissions.
    • If the public.pgxc_copy_error_log table or the copy_error_log_relname_idx index already exists before the function creates it, the function will report an error and roll back.

    Table 1 Error table public.pgxc_copy_error_log

    Column

    Type

    Description

    relname

    varchar

    Table name in the form of Schema name.Table name

    begintime

    timestamp with time zone

    Time when a data format error was reported

    filename

    character varying

    Name of the source data file where a data format error occurs

    rownum

    bigint

    Number of the row where a data format error occurs in a source data file

    rawrecord

    text

    Raw record of a data format error in the source data file

    detail

    text

    Error details

  • pg_stat_get_data_senders()

    Description: Provides detailed information about the data-copy sending thread active at the moment.

    Return type: record

  • generate_wdr_report(begin_snap_id Oid, end_snap_id Oid, int report_type, int report_scope, int node_name)

    Description: Generates system diagnosis reports based on two snapshots.

    Return type: record

    Table 2 Parameter description

    Parameter

    Description

    Value Range

    begin_snap_id

    Snapshot ID that starts the diagnosis report period.

    -

    end_snap_id

    Snapshot ID that ends the diagnosis report period. By default, the value of end_snap_id is greater than that of begin_snap_id.

    -

    report_type

    Specifies the type of the generated report.

    • summary
    • detail
    • all: Both summary and detail types are included.

    report_scope

    Specifies the scope for a report to be generated.

    node: a node in openGauss

    node_name

    When report_scope is set to node, set this parameter to the name of the corresponding node.

    -

  • create_wdr_snapshot(stat text, dbid Oid)

    Description: Manually generates system diagnosis snapshots.

    Return type: record

    Table 3 Parameter description

    Parameter

    Description

    stat

    Specifies the name of the node for each snapshot. By default, the status information of all nodes is collected.

    dbid

    ID of the database whose status information is to be collected.

  • wdr_xdb_query(db_name_str text, query text)

    Description: Provides the capability of executing cross-database queries at local. For example, when connecting to the Postgres database, access tables in the test database.

    select col1 from wdr_xdb_query('dbname=test','select col1 from t1') as dd(col1 int);
    

    Return type: record

  • pg_wlm_jump_queue(pid int)

    Description: Moves a task to the top of the primary database node queue.

    Return type: Boolean

    • true: success
    • false: failure
  • gs_wlm_switch_cgroup(pid int, cgroup text)

    Description: Moves a job to other Cgroup to improve the job priority.

    Return type: Boolean

    • true: success
    • false: failure
  • pv_session_memctx_detail(threadid tid, MemoryContextName text)

    Description: Record information about the memory context MemoryContextName of the thread tid into the threadid_timestamp.log file in the /tmp/dumpmem directory. threadid can be obtained from sessid in the PV_SESSION_MEMORY_DETAIL table. When MemoryContextName is set to '', all memory context information is recorded.

    Return type: Boolean

    • true: success
    • false: failure
  • pg_shared_memctx_detail(MemoryContextName text)

    Description: Record information about the memory context MemoryContextName into the threadid_timestamp.log file in the /tmp/dumpmem directory.

    Return type: Boolean

    • true: success
    • false: failure

NOTE:
pgxc_lock_for_backup locks openGauss before gs_dump or gs_dumpall is used to back up openGauss. After openGauss is locked, operations changing the system structure are not allowed. This function does not affect DML statements.

Feedback
编组 3备份
    openGauss 2025-06-30 22:42:51
    cancel