Example:
To obtain a file containing a list of all devices and their current status, do the following:
- Run the following commands to disable pagination and redirect PostgreSQL output to a file on Linux:
\pset pager
\o /tmp/DeviceStatus_AllDevices.txt
- Output a list of all devices and their current status to the file by running the following query:
SELECT device_name, device_idx, device_status, is_operational_device FROM cm_device ORDER BY device_status, device_id;
- Run the following commands to restore standard output to the PostgreSQL client
\o
\pset pager
Operating system shell or command line environment variables containing path information are not available inside the PostgreSQL client.
The PostgreSQL client does not automatically have full 'admin' or 'root' disk write priviliges. Make sure appropriate write permissions are enabled on the target <absolute_path> (such as the
/tmp directory in Linux).
If no <absolute_path> is included, the file will be created in the <product home>/db/controldb/ directory.