Re: column names query

From: Manuel Gómez <targen(at)gmail(dot)com>
To: hamann(dot)w(at)t-online(dot)de, pgsql-general(at)postgresql(dot)org
Subject: Re: column names query
Date: 2017-09-07 13:29:37
Message-ID: CAJWnFaPw=LpHWzuXPb7NqbjyewfLOYWNESA2Qe1hMJmdY6W=zg@mail.gmail.com
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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ron Johnson 2017-09-07 13:51:17 WAL & ready files retained after turning off log shipping
Previous Message hamann.w 2017-09-07 13:26:54 Re: column names query