↑↓ 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_file

Read the PG 18 manual

Returns all or part of a text file, starting at the given byte offset, returning at most length bytes (less if the end of file is reached first).

Reading PG 18current·documented in 22 of 27 versions, 8.1 to 20

Signatures & examples

pg_read_file ( filename text [, offset bigint, length bigint ] [, missing_ok boolean ] ) → text
Returns all or part of a text file, starting at the given byte offset, returning at most length bytes (less if the end of file is reached first). If offset is negative, it is relative to the end of the file. If offset and length are omitted, the entire file is returned. The bytes read from the file are interpreted as a string in the database's encoding; an error is thrown if they are not valid in that encoding.
Version history 6
  1. 15 → 16 changed
  2. 12 → 13 changed
  3. 10 → 11 changed
  4. 9.4 → 9.5 changed
  5. 9.0 → 9.1 changed
  6. 8.0 → 8.1 added

Definition snapshot: b7bd9cda · English manual source