>> On Thu, Sep 7, 2017 at 9:18 AM, <hamann.w@xxxxxxxxxxx> wrote: >> > is there a simple way to retrieve column names from a query - basically the way psql adds >> > column headings when I do a select? >> >> How do you do the query? I mean, JDBC, PERL? After all psql is just a >> C program doing a query using libpq and can do it, we may provide some >> useful info if you show yours first. >> >> Francisco Olarte. Hi, I imagine this situation: I start working on a query... when I am happy with the result, I see a table (with headers) in psql. Now I can do \copy (select .... my query here) to /tmp/testfile1 I would like to do something like \copy (select heading(select .... my query here)) to /tmp/heading_testfile1 Best regards Wolfgang Hamann -- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general