PostgreSQL Source Code  git master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
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-2017, 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  (ParallelMasterBackendId == InvalidBackendId ? MyBackendId : ParallelMasterBackendId)
36 
37 #endif /* BACKENDID_H */
PGDLLIMPORT BackendId ParallelMasterBackendId
Definition: globals.c:75
#define PGDLLIMPORT
Definition: c.h:1069
int BackendId
Definition: backendid.h:21
PGDLLIMPORT BackendId MyBackendId
Definition: globals.c:73