PostgreSQL Source Code  git master
backendid.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * backendid.h
4  * POSTGRES backend id communication definitions
5  *
6  *
7  * Portions Copyright (c) 1996-2023, PostgreSQL Global Development Group
8  * Portions Copyright (c) 1994, Regents of the University of California
9  *
10  * src/include/storage/backendid.h
11  *
12  *-------------------------------------------------------------------------
13  */
14 #ifndef BACKENDID_H
15 #define BACKENDID_H
16 
17 /* ----------------
18  * -cim 8/17/90
19  * ----------------
20  */
21 typedef int BackendId; /* unique currently active backend identifier */
22 
23 #define InvalidBackendId (-1)
24 
25 extern PGDLLIMPORT BackendId MyBackendId; /* backend id of this backend */
26 
27 /* backend id of our parallel session leader, or InvalidBackendId if none */
29 
30 /*
31  * The BackendId to use for our session's temp relations is normally our own,
32  * but parallel workers should use their leader's ID.
33  */
34 #define BackendIdForTempRelations() \
35  (ParallelLeaderBackendId == InvalidBackendId ? MyBackendId : ParallelLeaderBackendId)
36 
37 #endif /* BACKENDID_H */
int BackendId
Definition: backendid.h:21
PGDLLIMPORT BackendId MyBackendId
Definition: globals.c:85
PGDLLIMPORT BackendId ParallelLeaderBackendId
Definition: globals.c:87
#define PGDLLIMPORT
Definition: c.h:1326