System Administration Functions

This reference describes administration functions for operators. These functions require elevated privileges and can affect cluster availability.

Coordinator management

gp_remove_coordinator_by_dbid

Removes a coordinator entry from the gp_segment_configuration catalog by its dbid.

Signature

gp_remove_coordinator_by_dbid(dbid int2) RETURNS boolean

When to use it

This function gives operators a safe, explicit way to remove a coordinator entry from gp_segment_configuration. Use it when you need to delete a specific coordinator entry by its dbid.

You cannot use this function to remove the running coordinator: it rejects the dbid of the coordinator that you are connected to.

Prerequisites

  • You connect to the coordinator node in utility mode.

  • You connect as a superuser.

  • You know the dbid of the entry to remove. Query gp_segment_configuration first to confirm.

Procedure

  1. Connect to the coordinator node in utility mode as a superuser:

    PGOPTIONS='-c gp_session_role=utility' psql -U gpadmin -d postgres
    
  2. Confirm the target entry:

    SELECT dbid, content, role, status, hostname
    FROM gp_segment_configuration
    WHERE dbid = <target-dbid>;
    
  3. Remove the entry:

    SELECT gp_remove_coordinator_by_dbid(<target-dbid>::int2);
    

    The parameter type is int2. You must cast integer literals explicitly; otherwise the type resolver reports function does not exist. The function returns true on success.

Safety notes

  • The function rejects the dbid of the running coordinator.

  • The function rejects any dbid that does not identify a coordinator entry. Other rows in gp_segment_configuration are not modified.

  • The function holds AccessExclusiveLock on gp_segment_configuration until it returns. All other reads and writes on that catalog wait for the call to complete.