pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Condor <condor@stz-bg.com>
To: David G. Johnston <david.g.johnston@gmail.com>
Cc: pgsql-general <pgsql-general@lists.postgresql.org>
Subject: Re: Is there a way to replace select * fields in result ?
Date: Sat, 12 Jun 2021 11:18:50 +0300
Message-ID: <2959e6c600c63c6a1e5974c59e42d341@stz-bg.com> (raw)
In-Reply-To: <CAKFQuwY1jJjGy+YrDzisu2Z8GRTkKiVKPC339f93UkPM++EbAQ@mail.gmail.com>
References: <37a2bc0c7c8e90ea7620297e8d23515a@stz-bg.com>
	<CAKFQuwY1jJjGy+YrDzisu2Z8GRTkKiVKPC339f93UkPM++EbAQ@mail.gmail.com>

On 12-06-2021 11:13, David G. Johnston wrote:
> On Saturday, June 12, 2021, Condor <condor@stz-bg.com> wrote:
> 
>> 
>> Hello,
>> 
>> Is there a way to replace select * fileds in result ?
>> I have select qw.* from table but I want field for example mm to be
>> replaced with custom value like:
>> 
>> select qw.*, case whem length(qw.mm) > 0 THEN 
>> COALESCE(SUBSTRING(qw.mm,
>> 1, 1), '') ELSE qw.mm END AS qw.mm
>> 
>> Is there some way to do that ?
>> 
>> 
> No.  If you don’t want a column from “*” to appear in the output you 
> cannot
> use “*”.  In general, for production, you should avoid “*” anyway.
> 
> David J.

Uh .. yes I know. I trying to revisit old procedures from team that left 
the project ... and it's seems they use select * to a lot of places.

Thanks,





view thread (4+ messages)  latest in thread

Message-ID: <2959e6c600c63c6a1e5974c59e42d341@stz-bg.com>
Permalink:  ../2959e6c600c63c6a1e5974c59e42d341@stz-bg.com/
Also on:    postgresql.org/message-id/2959e6c600c63c6a1e5974c59e42d341@stz-bg.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: condor@stz-bg.com, david.g.johnston@gmail.com
  Subject: Re: Is there a way to replace select * fields in result ?
  In-Reply-To: <2959e6c600c63c6a1e5974c59e42d341@stz-bg.com>
  References: <37a2bc0c7c8e90ea7620297e8d23515a@stz-bg.com> <CAKFQuwY1jJjGy+YrDzisu2Z8GRTkKiVKPC339f93UkPM++EbAQ@mail.gmail.com> <2959e6c600c63c6a1e5974c59e42d341@stz-bg.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox