pg_options_to_table()

A function which returns storage options as a set of rows

pg_options_to_table() is a system function which returns storage parameters as a set of rows.

pg_options_to_table() was added in PostgreSQL 9.1.

Usage

pg_options_to_table() is a convenience function for extracting configuration parameter values stored as an array in various system catalog tables e.g.:

Source code

pg_options_to_table() is defined in src/backend/foreign/foreign.c.

Note that it was initially added as part of the foreign data wrapper implementation, but is not specific to FDW support.

Change history

Examples

List storage parameters for a table:

postgres=# SELECT option_name, option_value
             FROM pg_class c, pg_options_to_table(c.reloptions)
            WHERE c.oid = 'foo'::REGCLASS;
         option_name         | option_value
-----------------------------+--------------
 log_autovacuum_min_duration | 50
 fillfactor                  | 75
(2 rows)

Categories

System catalogue, System function

See also

storage parameters, pg_class, pg_attribute