select open change scope Open full search

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

FUNCTIONS / SYSTEM ADMINISTRATION FUNCTIONS

Returns the names of all files (and directories and other special files) in the specified directory.

Signatures & examples

pg_ls_dir ( dirname text [, missing_ok boolean, include_dot_dirs boolean ] ) → setof text
Returns the names of all files (and directories and other special files) in the specified directory. The include_dot_dirs parameter indicates whether . and .. are to be included in the result set; the default is to exclude them. Including them can be useful when missing_ok is true, to distinguish an empty directory from a non-existent directory.
Version history 3
  1. PG 12 → 13changed
  2. PG 10 → 11changed
  3. PG 9.4 → 9.5changed

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