src/Db/Pgsql/QueryBuilder.php
protected function getTablePrimaryKey($table, $asArray = false) {
        $tableSchema = $this->db->getSchema()->getTableSchema($table);
        $primaryKeys = $tableSchema->primaryKey;
        if (empty($primaryKeys)) {
            return $asArray ? [] : null;
        }
        return $asArray ? $primaryKeys : reset($primaryKeys);
    }
protected function getTablePrimaryKey($table, $asArray = false) {
        $tableSchema = $this->db->getSchema()->getTableSchema($table);
        $primaryKeys = $tableSchema->primaryKey;
        if (empty($primaryKeys)) {
            return $asArray ? [] : null;
        }
        return $asArray ? $primaryKeys : reset($primaryKeys);
    }
Get table primary key column(s)
@param string $table
@param bool   $asArray
@return array|mixed|null|string[]