# Source Atlas

PostgreSQL functions, and where this site explains each one: the reverse of a code trail.

> Canonical URL: https://sudohulk.com/atlas
> PostgreSQL: 18.3 (`REL_18_3`)
> As JSON: https://sudohulk.com/atlas.json
> Author: Vignesh Kumar A <vignesh@sudohulk.com>
> Licence: CC BY 4.0. Quote freely, cite the canonical URL.

---

Every line is looked up in the source this site commits at that release, so the links move with it.

## contrib/postgres_fdw/connection.c

- `pgfdw_inval_callback`, [connection.c:1295](https://github.com/postgres/postgres/blob/REL_18_3/contrib/postgres_fdw/connection.c#L1295)
  - [How PostgreSQL tells every connection its cache is stale: Keeping your own cache honest](https://sudohulk.com/writing/postgres-cache-invalidation#keeping-your-own-cache-honest)
  - [How PostgreSQL tells every connection its cache is stale: Dig deeper](https://sudohulk.com/writing/postgres-cache-invalidation#dig-deeper), a code trail

## contrib/postgres_fdw/shippable.c

- `InvalidateShippableCacheCallback`, [shippable.c:64](https://github.com/postgres/postgres/blob/REL_18_3/contrib/postgres_fdw/shippable.c#L64)
  - [How PostgreSQL tells every connection its cache is stale: Keeping your own cache honest](https://sudohulk.com/writing/postgres-cache-invalidation#keeping-your-own-cache-honest)

## src/backend/access/transam/xact.c

- `AtStart_Cache`, [xact.c:1166](https://github.com/postgres/postgres/blob/REL_18_3/src/backend/access/transam/xact.c#L1166)
  - [How PostgreSQL tells every connection its cache is stale: Dig deeper](https://sudohulk.com/writing/postgres-cache-invalidation#dig-deeper), a code trail
- `CommitTransaction`, [xact.c:2227](https://github.com/postgres/postgres/blob/REL_18_3/src/backend/access/transam/xact.c#L2227)
  - [How PostgreSQL tells every connection its cache is stale: Dig deeper](https://sudohulk.com/writing/postgres-cache-invalidation#dig-deeper), a code trail

## src/backend/storage/ipc/sinval.c

- `ProcessCatchupInterrupt`, [sinval.c:173](https://github.com/postgres/postgres/blob/REL_18_3/src/backend/storage/ipc/sinval.c#L173)
  - [How PostgreSQL tells every connection its cache is stale: Dig deeper](https://sudohulk.com/writing/postgres-cache-invalidation#dig-deeper), a code trail
- `ReceiveSharedInvalidMessages`, [sinval.c:68](https://github.com/postgres/postgres/blob/REL_18_3/src/backend/storage/ipc/sinval.c#L68)
  - [How PostgreSQL tells every connection its cache is stale: Reading the ring before trusting the cache](https://sudohulk.com/writing/postgres-cache-invalidation#reading-the-ring-before-trusting-the-cache)
  - [How PostgreSQL tells every connection its cache is stale: Dig deeper](https://sudohulk.com/writing/postgres-cache-invalidation#dig-deeper), a code trail

## src/backend/storage/ipc/sinvaladt.c

- `SICleanupQueue`, [sinvaladt.c:576](https://github.com/postgres/postgres/blob/REL_18_3/src/backend/storage/ipc/sinvaladt.c#L576)
  - [How PostgreSQL tells every connection its cache is stale: When the ring fills up](https://sudohulk.com/writing/postgres-cache-invalidation#when-the-ring-fills-up)
  - [How PostgreSQL tells every connection its cache is stale: Dig deeper](https://sudohulk.com/writing/postgres-cache-invalidation#dig-deeper), a code trail
- `SIGetDataEntries`, [sinvaladt.c:472](https://github.com/postgres/postgres/blob/REL_18_3/src/backend/storage/ipc/sinvaladt.c#L472)
  - [How PostgreSQL tells every connection its cache is stale: Reading the ring before trusting the cache](https://sudohulk.com/writing/postgres-cache-invalidation#reading-the-ring-before-trusting-the-cache)
  - [How PostgreSQL tells every connection its cache is stale: Dig deeper](https://sudohulk.com/writing/postgres-cache-invalidation#dig-deeper), a code trail
- `SIInsertDataEntries`, [sinvaladt.c:369](https://github.com/postgres/postgres/blob/REL_18_3/src/backend/storage/ipc/sinvaladt.c#L369)
  - [How PostgreSQL tells every connection its cache is stale: The ring of messages](https://sudohulk.com/writing/postgres-cache-invalidation#the-ring-of-messages)
  - [How PostgreSQL tells every connection its cache is stale: Dig deeper](https://sudohulk.com/writing/postgres-cache-invalidation#dig-deeper), a code trail

## src/backend/storage/lmgr/lmgr.c

- `LockRelationOid`, [lmgr.c:106](https://github.com/postgres/postgres/blob/REL_18_3/src/backend/storage/lmgr/lmgr.c#L106)
  - [How PostgreSQL tells every connection its cache is stale: Reading the ring before trusting the cache](https://sudohulk.com/writing/postgres-cache-invalidation#reading-the-ring-before-trusting-the-cache)
  - [How PostgreSQL tells every connection its cache is stale: Dig deeper](https://sudohulk.com/writing/postgres-cache-invalidation#dig-deeper), a code trail

## src/backend/utils/cache/inval.c

- `AcceptInvalidationMessages`, [inval.c:929](https://github.com/postgres/postgres/blob/REL_18_3/src/backend/utils/cache/inval.c#L929)
  - [How PostgreSQL tells every connection its cache is stale: Reading the ring before trusting the cache](https://sudohulk.com/writing/postgres-cache-invalidation#reading-the-ring-before-trusting-the-cache)
  - [How PostgreSQL tells every connection its cache is stale: Dig deeper](https://sudohulk.com/writing/postgres-cache-invalidation#dig-deeper), a code trail
- `AtEOXact_Inval`, [inval.c:1198](https://github.com/postgres/postgres/blob/REL_18_3/src/backend/utils/cache/inval.c#L1198)
  - [How PostgreSQL tells every connection its cache is stale: Collecting changes until commit](https://sudohulk.com/writing/postgres-cache-invalidation#collecting-changes-until-commit)
  - [How PostgreSQL tells every connection its cache is stale: Dig deeper](https://sudohulk.com/writing/postgres-cache-invalidation#dig-deeper), a code trail
- `CacheRegisterRelcacheCallback`, [inval.c:1857](https://github.com/postgres/postgres/blob/REL_18_3/src/backend/utils/cache/inval.c#L1857)
  - [How PostgreSQL tells every connection its cache is stale: Keeping your own cache honest](https://sudohulk.com/writing/postgres-cache-invalidation#keeping-your-own-cache-honest)
  - [How PostgreSQL tells every connection its cache is stale: Dig deeper](https://sudohulk.com/writing/postgres-cache-invalidation#dig-deeper), a code trail
- `CacheRegisterSyscacheCallback`, [inval.c:1815](https://github.com/postgres/postgres/blob/REL_18_3/src/backend/utils/cache/inval.c#L1815)
  - [How PostgreSQL tells every connection its cache is stale: Keeping your own cache honest](https://sudohulk.com/writing/postgres-cache-invalidation#keeping-your-own-cache-honest)
  - [How PostgreSQL tells every connection its cache is stale: Dig deeper](https://sudohulk.com/writing/postgres-cache-invalidation#dig-deeper), a code trail
- `CommandEndInvalidationMessages`, [inval.c:1408](https://github.com/postgres/postgres/blob/REL_18_3/src/backend/utils/cache/inval.c#L1408)
  - [How PostgreSQL tells every connection its cache is stale: Collecting changes until commit](https://sudohulk.com/writing/postgres-cache-invalidation#collecting-changes-until-commit)
  - [How PostgreSQL tells every connection its cache is stale: Dig deeper](https://sudohulk.com/writing/postgres-cache-invalidation#dig-deeper), a code trail
- `InvalidateSystemCachesExtended`, [inval.c:784](https://github.com/postgres/postgres/blob/REL_18_3/src/backend/utils/cache/inval.c#L784)
  - [How PostgreSQL tells every connection its cache is stale: When the ring fills up](https://sudohulk.com/writing/postgres-cache-invalidation#when-the-ring-fills-up)
  - [How PostgreSQL tells every connection its cache is stale: Dig deeper](https://sudohulk.com/writing/postgres-cache-invalidation#dig-deeper), a code trail
