2
0

backendid.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. /*-------------------------------------------------------------------------
  2. *
  3. * backendid.h
  4. * POSTGRES backend id communication definitions
  5. *
  6. *
  7. * Portions Copyright (c) 1996-2022, 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. * -cim 8/17/90
  18. * ----------------
  19. */
  20. typedef int BackendId; /* unique currently active backend identifier */
  21. #define InvalidBackendId (-1)
  22. extern PGDLLIMPORT BackendId MyBackendId; /* backend id of this backend */
  23. /* backend id of our parallel session leader, or InvalidBackendId if none */
  24. extern PGDLLIMPORT BackendId ParallelLeaderBackendId;
  25. /*
  26. * The BackendId to use for our session's temp relations is normally our own,
  27. * but parallel workers should use their leader's ID.
  28. */
  29. #define BackendIdForTempRelations() \
  30. (ParallelLeaderBackendId == InvalidBackendId ? MyBackendId : ParallelLeaderBackendId)
  31. #endif /* BACKENDID_H */