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 1jswEN-0006lP-15 for pgsql-admin@arkaria.postgresql.org; Tue, 07 Jul 2020 22:38:27 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jswEL-00040l-VB for pgsql-admin@arkaria.postgresql.org; Tue, 07 Jul 2020 22:38:25 +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 1jswEL-00040e-NW for pgsql-admin@lists.postgresql.org; Tue, 07 Jul 2020 22:38:25 +0000 Received: from jakobs.com ([85.214.83.89] helo=rs.plausibolo.de) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jswEJ-0007oR-9d for pgsql-admin@lists.postgresql.org; Tue, 07 Jul 2020 22:38:24 +0000 Received: from localhost (localhost [127.0.0.1]) by rs.plausibolo.de (Postfix) with ESMTP id D9621380980; Wed, 8 Jul 2020 00:38:19 +0200 (CEST) Received: from rs.plausibolo.de ([IPv6:::1]) by localhost (h2367442.stratoserver.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id a7E06J9gH74J; Wed, 8 Jul 2020 00:38:19 +0200 (CEST) Received: from [192.168.178.91] (i59F67812.versanet.de [89.246.120.18]) by rs.plausibolo.de (Postfix) with ESMTPSA id 83EA7380973; Wed, 8 Jul 2020 00:38:19 +0200 (CEST) Subject: Re: SELECTing from a function where i don't want the results To: pgsql-admin@lists.postgresql.org References: From: Holger Jakobs Message-ID: <5cbe6f6d-5db5-9020-a58b-48ecf91efd61@jakobs.com> Date: Wed, 8 Jul 2020 00:38:18 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/alternative; boundary="------------C40E2DFDAE1BF5FE49363BBD" Content-Language: de-DE List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This is a multi-part message in MIME format. --------------C40E2DFDAE1BF5FE49363BBD Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit You could combine the result with a NULL value, as any operations with NULL result in NULL. SELECT mydelete(r) + NULL FROM sometable; Am 08.07.20 um 00:34 schrieb Wells Oliver: > Vanilla SQL script calls a plpgsql function to delete some number of > rows from three tables: > > SELECT mydelete(r) FROM sometable; > > Where sometable contains maybe 100+ records. This causes the results > from the function (integer of number of rows removed) to be displayed > in the output, like you'd kinda expect with a SELECT call, except I > don't want to see it all, I just want the function quietly executed > and rows removed. > > Can I accomplish this? > > -- > Wells Oliver > wells.oliver@gmail.com -- Holger Jakobs, Bergisch Gladbach, Tel. +49-178-9759012 --------------C40E2DFDAE1BF5FE49363BBD Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 7bit

You could combine the result with a NULL value, as any operations with NULL result in NULL.

SELECT mydelete(r) + NULL FROM sometable;

Am 08.07.20 um 00:34 schrieb Wells Oliver:
Vanilla SQL script calls a plpgsql function to delete some number of rows from three tables:

SELECT mydelete(r) FROM sometable;

Where sometable contains maybe 100+ records. This causes the results from the function (integer of number of rows removed) to be displayed in the output, like you'd kinda expect with a SELECT call, except I don't want to see it all, I just want the function quietly executed and rows removed.

Can I accomplish this?

--
-- 
Holger Jakobs, Bergisch Gladbach, Tel. +49-178-9759012
--------------C40E2DFDAE1BF5FE49363BBD--