Hi Hamman: On Thu, Sep 7, 2017 at 3:17 PM, <hamann.w@xxxxxxxxxxx> wrote: > I would like to do something like > \copy (select heading(select .... my query here)) to /tmp/heading_testfile1 It's already been pointed out, you can do something using CSV copy with headers ( Why headers are not allowed in other formats remains a mistery to me), and LIMIT 0 ( I would try adding AND FALSE to the where clause better, it may lead to faster response, although I doubt it) . Francisco Olarte. -- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general