COPY <tablename> TO STDOUT (DELIMITER '|');
To export table user to Standard ouput:
COPY user TO STDOUT (DELIMITER '|');
COPY user FROM '/home/user/user_data' WITH DELIMITER '|';
COPY (sql statement) TO '<filename with path>';
COPY (SELECT * FROM user WHERE user_name LIKE 'A%') TO '/home/user/user_data';
COPY user TO PROGRAM 'gzip > /home/user/user_data.gz';
Here program gzip is executed to compress user table data.