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-08 06:16:20
Message-ID: wolfgang-1170908081620.A0530521@noten19.local
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

>> On Thu, Sep 7, 2017 at 3:28 PM <hamann(dot)w(at)t-online(dot)de> wrote:
>>
>> > Example query
>> > select a.col1, case when a.col2 > 0 then a.col3 else b.xcol1 end as mycol3
>> > from a left join b on ....
>> > Expected response
>> > col1 mycol3
>> >
>>
>> This may be overkill, but works:
>>
>> postgres=# \copy (select 1 as foo, 2 as bar limit 0) to stdout with (format
>> csv, header, delimiter ' ')
>> foo bar
>>

Hi Manuel,

this works perfectly, many thanks

Wolfgang

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2017-09-08 11:56:12 Re: B-tree index on a VARCHAR(4000) column
Previous Message Craig Ringer 2017-09-08 04:12:35 Re: BDR, wal segment has been removed, is it possible move forward?