docstr: Get Postgres PID that will be used to cancel all other running
  queries in the same session.
  
  :param cursor: Cursor instance in which the query will be executed
  :param query: Query instance
  :return: Postgres PID
docstr_tok: ["Get","Postgres","PID","that","will","be","used","to","cancel","all","other","running","queries","in","the","same","session",".",":","param","cursor",":","Cursor","instance","in","which","the","query","will","be","executed",":","param","query",":","Query","instance",":","return",":","Postgres","PID"]
code: def get_cancel_query_id(cls, cursor: Any, query: Query) -> str | None:
      """
      Get Postgres PID that will be used to cancel all other running
      queries in the same session.
  
      :param cursor: Cursor instance in which the query will be executed
      :param query: Query instance
      :return: Postgres PID
      """
      cursor.execute("SELECT pg_backend_pid()")
      row = cursor.fetchone()
      return row[0]
  
imports: from __future__ import annotations
  import json
  import logging
  import re
  from datetime import datetime
  from re import Pattern
  from typing import Any, TYPE_CHECKING
  import sqlparse
  from flask_babel import gettext
  from sqlalchemy.dialects.postgresql import DOUBLE_PRECISION, ENUM, JSON
  from sqlalchemy.dialects.postgresql.base import PGInspector
  from sqlalchemy.engine.reflection import Inspector
  from sqlalchemy.engine.url import URL
  from sqlalchemy.types import Date, DateTime, String
  from superset.constants import TimeGrain
  from superset.db_engine_specs.base import BaseEngineSpec, BasicParametersMixin
  from superset.errors import ErrorLevel, SupersetError, SupersetErrorType
  from superset.exceptions import SupersetException, SupersetSecurityException
  from superset.models.sql_lab import Query
  from superset.utils import core
  from superset.utils.core import GenericDataType
label_desc: Use image node_id 11 for calling the PostgresEngineSpec obj's underlying member method code with example usage: obj.get_cancel_query_id(cls, cursor, query) and returns: row