Unmark gen_random_uuid() function leakproof.
[pgsql.git] / src / include / storage / procnumber.h
blob49eb0e215ccad092456b42f1ca5c5f6e85a439d0
1 /*-------------------------------------------------------------------------
3 * procnumber.h
4 * definition of process number
7 * Portions Copyright (c) 1996-2024, PostgreSQL Global Development Group
8 * Portions Copyright (c) 1994, Regents of the University of California
10 * src/include/storage/procnumber.h
12 *-------------------------------------------------------------------------
14 #ifndef PROCNUMBER_H
15 #define PROCNUMBER_H
18 * ProcNumber uniquely identifies an active backend or auxiliary process.
19 * It's assigned at backend startup after authentication, when the process
20 * adds itself to the proc array. It is an index into the proc array,
21 * starting from 0. Note that a ProcNumber can be reused for a different
22 * backend immediately after a backend exits.
24 typedef int ProcNumber;
26 #define INVALID_PROC_NUMBER (-1)
29 * Proc number of this backend (same as GetNumberFromPGProc(MyProc))
31 extern PGDLLIMPORT ProcNumber MyProcNumber;
33 /* proc number of our parallel session leader, or INVALID_PROC_NUMBER if none */
34 extern PGDLLIMPORT ProcNumber ParallelLeaderProcNumber;
37 * The ProcNumber to use for our session's temp relations is normally our own,
38 * but parallel workers should use their leader's proc number.
40 #define ProcNumberForTempRelations() \
41 (ParallelLeaderProcNumber == INVALID_PROC_NUMBER ? MyProcNumber : ParallelLeaderProcNumber)
43 #endif /* PROCNUMBER_H */