select open change scope Open full search

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

FUNCTIONS / SYSTEM ADMINISTRATION FUNCTIONS

pg_read_binary_file

Read PG 18 manual ↗

Returns all or part of a file.

Signatures & examples

pg_read_binary_file ( filename text [, offset bigint, length bigint ] [, missing_ok boolean ] ) → bytea
Returns all or part of a file. This function is identical to pg_read_file except that it can read arbitrary binary data, returning the result as bytea not text; accordingly, no encoding checks are performed.
Version history 5
  1. PG 15 → 16changed
  2. PG 12 → 13changed
  3. PG 10 → 11changed
  4. PG 9.4 → 9.5changed
  5. PG 9.0 → 9.1added

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