Re: Is there a way to replace select * fields in result ?

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Condor <condor(at)stz-bg(dot)com>
Cc: pgsql-general <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Is there a way to replace select * fields in result ?
Date: 2021-06-12 08:13:04
Message-ID: CAKFQuwY1jJjGy+YrDzisu2Z8GRTkKiVKPC339f93UkPM++EbAQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Saturday, June 12, 2021, Condor <condor(at)stz-bg(dot)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.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Condor 2021-06-12 08:18:50 Re: Is there a way to replace select * fields in result ?
Previous Message Condor 2021-06-12 08:00:34 Is there a way to replace select * fields in result ?