Skip to main content
Experimental feature Advice on use of experimental features FILE is a scalar type that describes a file, or a byte range inside a file. A FILE value has a fixed set of fields that can be extracted using the FL_GET_* functions. FILE currently cannot be persisted in the database. FILE values can be obtained from external catalogs or constructed using TO_FILE or TRY_TO_FILE. For syntax and examples, see FILE functions.

Structure

Every FILE value carries the same fields, in this order. Each field can be NULL. A FILE value is one of the following:
  • A reference: uri is set, usually together with offset and size, and inline is NULL.
  • Inline content: inline holds the bytes; uri, offset, and size must all be NULL.

Output format

A FILE value is rendered as a JSON-like object that lists all fields:
text
The inline bytes are encoded according to the session variable binary_encoding_format.

Limitations

  • FILE cannot be used as a column type in CREATE TABLE, CREATE TABLE AS SELECT, or materialized views.
  • FILE values cannot be compared, sorted, grouped, joined on, used with DISTINCT, cast to or from other types, or passed to window functions.
  • IS NULL and IS NOT NULL are supported.