select open change scope Open full search

PG.CENTER connects PostgreSQL documentation, reference, and ecosystem knowledge. Maintained by Pigsty.

FUNCTIONS / SYSTEM ADMINISTRATION FUNCTIONS

pg_relation_filenode

Read PG 18 manual ↗

Returns the “filenode” number currently assigned to the specified relation.

Signatures & examples

pg_relation_filenode ( relation regclass ) → oid
Returns the filenode number currently assigned to the specified relation. The filenode is the base component of the file name(s) used for the relation (see Section 66.1 for more information). For most relations the result is the same as pg_class.relfilenode, but for certain system catalogs relfilenode is zero and this function must be used to get the correct value. The function returns NULL if passed a relation that does not have storage, such as a view.
Version history 6
  1. PG 17 → 18changed
  2. PG 16 → 17changed
  3. PG 14 → 15changed
  4. PG 13 → 14changed
  5. PG 12 → 13changed
  6. PG 9.0 → 9.1changed

Definition snapshot: 2026-09-14T13:14:25.684213+00:00@99e6866c · English manual source