

 Amazon Redshift non supporterà più la creazione di nuovi Python UDFs a partire dalla Patch 198. Python esistente UDFs continuerà a funzionare fino al 30 giugno 2026. Per ulteriori informazioni, consulta il [post del blog](https://aws.amazon.com/blogs/big-data/amazon-redshift-python-user-defined-functions-will-reach-end-of-support-after-june-30-2026/). 

Le traduzioni sono generate tramite traduzione automatica. In caso di conflitto tra il contenuto di una traduzione e la versione originale in Inglese, quest'ultima prevarrà.

# PG\$1BACKEND\$1PID
<a name="PG_BACKEND_PID"></a>

Restituisce l'ID di processo (PID) del processo del server che gestisce la sessione corrente.

**Nota**  
L'PID non è univoco a livello globale. Può essere riutilizzato nel tempo.

## Sintassi
<a name="PG_BACKEND_PID-synopsis"></a>

```
pg_backend_pid()
```

## Tipo restituito
<a name="PG_BACKEND_PID-return-type"></a>

Restituisce un integer.

## Esempio
<a name="PG_BACKEND_PID-example"></a>

È possibile correlare PG\$1BACKEND\$1PID() con le tabelle di registro per recuperare le informazioni sulla sessione corrente. Ad esempio, la query seguente restituisce l'ID di query e una porzione del testo di query delle query completate nella sessione corrente.

```
select query, substring(text,1,40)
from stl_querytext
where pid =  PG_BACKEND_PID()
order by query desc;

 query |                substring
-------+------------------------------------------
 14831 | select query, substring(text,1,40) from
 14827 | select query, substring(path,0,80) as pa
 14826 | copy category from 's3://dw-tickit/manif
 14825 | Count rows in target table
 14824 | unload ('select * from category') to 's3
(5 rows)
```

È possibile correlare PG\$1BACKEND\$1PID con la colonna pid nelle seguenti tabelle di log (le eccezioni sono indicate tra parentesi):
+ [STL\$1CONNECTION\$1LOG](r_STL_CONNECTION_LOG.md)
+ [STL\$1DDLTEXT](r_STL_DDLTEXT.md)
+ [STL\$1ERROR](r_STL_ERROR.md)
+ [STL\$1QUERY](r_STL_QUERY.md)
+ [STL\$1QUERYTEXT](r_STL_QUERYTEXT.md)
+ [STL\$1SESSIONS](r_STL_SESSIONS.md) (elaborazione)
+ [STL\$1TR\$1CONFLICT](r_STL_TR_CONFLICT.md)
+ [STL\$1UTILITYTEXT](r_STL_UTILITYTEXT.md)
+ [STV\$1ACTIVE\$1CURSORS](r_STV_ACTIVE_CURSORS.md)
+ [STV\$1INFLIGHT](r_STV_INFLIGHT.md)
+ [STV\$1LOCKS](r_STV_LOCKS.md) (lock\$1owner\$1pid)
+ [STV\$1RECENTS](r_STV_RECENTS.md) (process\$1id)