Re: column names query

From: hamann(dot)w(at)t-online(dot)de
To: pgsql-general(at)postgresql(dot)org
Subject: Re: column names query
Date: 2017-09-07 13:17:49
Message-ID: wolfgang-1170907151749.A0330521@noten19.local
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

>> On Thu, Sep 7, 2017 at 9:18 AM, <hamann(dot)w(at)t-online(dot)de> 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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message hamann.w 2017-09-07 13:26:54 Re: column names query
Previous Message milist ujang 2017-09-07 13:16:03 Re: BDR, wal segment has been removed, is it possible move forward?