Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lryr7-00044T-Ui for pgsql-general@arkaria.postgresql.org; Sat, 12 Jun 2021 08:19:01 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lryr6-00040e-CD for pgsql-general@arkaria.postgresql.org; Sat, 12 Jun 2021 08:19:00 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lryr6-00040U-3N for pgsql-general@lists.postgresql.org; Sat, 12 Jun 2021 08:19:00 +0000 Received: from stz-bg.com ([46.40.123.212] helo=mail.stzbg.com) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lryqz-0001lv-16 for pgsql-general@lists.postgresql.org; Sat, 12 Jun 2021 08:18:59 +0000 Received: from www.stz-bg.com (stz-bg.com [IPv6:2a02:6800:0:99::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) (Authenticated sender: condor@stz-bg.com) by mail.stzbg.com (Postfix) with ESMTPSA id 22A782E0FD3; Sat, 12 Jun 2021 11:18:50 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=stz-bg.com; s=mail; t=1623485930; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=l1Ra8aFD8scb05fgf9osTj63Or1yfvUfYfKnZtSCSlw=; b=sI8BiKoexSWLvY66ffTTyweLyP+baQX//guCJ4znOgzPI5p0OZ7I3gUpFQEP96qU6WiIBL aGgcN9SOsWJun4noUbnBYGZ/2fJlu23CGdZUSkUPwr5LK7LEBi5NEt0HxF4g5BgIRCFW4T FOt7I+CDW2T8X+gu7u/kZs9C0dXFo/Q= MIME-Version: 1.0 Date: Sat, 12 Jun 2021 11:18:50 +0300 From: Condor To: "David G. Johnston" Cc: pgsql-general Subject: Re: Is there a way to replace select * fields in result ? In-Reply-To: References: <37a2bc0c7c8e90ea7620297e8d23515a@stz-bg.com> User-Agent: Roundcube Webmail/1.4.11 Message-ID: <2959e6c600c63c6a1e5974c59e42d341@stz-bg.com> X-Sender: condor@stz-bg.com Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 12-06-2021 11:13, David G. Johnston wrote: > On Saturday, June 12, 2021, Condor wrote: >=20 >>=20 >> Hello, >>=20 >> 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: >>=20 >> select qw.*, case whem length(qw.mm) > 0 THEN=20 >> COALESCE(SUBSTRING(qw.mm, >> 1, 1), '') ELSE qw.mm END AS qw.mm >>=20 >> Is there some way to do that ? >>=20 >>=20 > No. If you don=E2=80=99t want a column from =E2=80=9C*=E2=80=9D to appea= r in the output you=20 > cannot > use =E2=80=9C*=E2=80=9D. In general, for production, you should avoid = =E2=80=9C*=E2=80=9D anyway. >=20 > David J. Uh .. yes I know. I trying to revisit old procedures from team that left=20 the project ... and it's seems they use select * to a lot of places. Thanks,