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 1pWjKd-0003OP-Eh for pgsql-general@arkaria.postgresql.org; Mon, 27 Feb 2023 19:38:43 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pWjKc-00027X-0d for pgsql-general@arkaria.postgresql.org; Mon, 27 Feb 2023 19:38:42 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pWjKa-00027O-Tf for pgsql-general@lists.postgresql.org; Mon, 27 Feb 2023 19:38:41 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pWjKY-0004Kx-0H for pgsql-general@postgresql.org; Mon, 27 Feb 2023 19:38:40 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id D0C4D5C0158; Mon, 27 Feb 2023 14:38:35 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Mon, 27 Feb 2023 14:38:35 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm3; t=1677526715; x= 1677613115; bh=eKHuNvhjPKpIjd/pfMUCGWmpuhGPPutINve46ocxhgI=; b=B SmVL+SrSP5pHSScWgOBbWxRJMy7zmSG0jM6HNYMMgtqJMARjKZabZaEgEMfEa7PG Y8cQbdUGCznxLQmxbtUtSCtG7IO7NgX+Mi3SW46t6JeAKaWzcOi2cXQZ+TNf0ZXS leH0IgVrq9+BEBt+elmEuKRJJL09gAecSClw3Zkdv1qqz6UV6laF8IwWo2kBye6d ZAScYZUsvvfQwbwWpfeqCIoLhj9C77irN2rZucZihmoR/0t8JtzTyNY3bJB+vpR4 wumPldMUSpuEbWiQKj2rNu7xaft9jIvMo8iDUr2T9Ie080ZkMke4IjZFMHj/MtsS eTdLAJob+rR3nj30ckzoA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:date:feedback-id:feedback-id:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; t=1677526715; x=1677613115; bh=e KHuNvhjPKpIjd/pfMUCGWmpuhGPPutINve46ocxhgI=; b=q3DHrgAS8EyR08GB5 OP+oYZnKAuk7FDIiv5MV9ux7ONK0YjWpaJ/eleyknRdomqEi15z4oO7K2Pbesst7 oMQqNObzewn3UBwzbfCu1cyxFqp0QVKfacAoeJUahpv85NU3OPalGR1VrmUxKxmC Y2SK8FO1PrahTKNs9j5gMXfyy2NNwIrLhFsVztyS1U240GyHxBGOzELkSDdmzabx EDPjFmgcPPCMiOiz2FXOU1stxOdqQ2xaVmHH6iVlaAYdcSHbzK73vXJxn0Bpua/V InEPXu8svxQsJnYt0iK9GGGKtIAAJmGrjQrXLRZvKqHdcLFLCTn5sCfQhzuwFNBX 0/RYA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrudeltddguddvfecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhepuffvfhfhkffffgggjggtgfesth ekredttdefjeenucfhrhhomheptegurhhirghnucfmlhgrvhgvrhcuoegrughrihgrnhdr khhlrghvvghrsegrkhhlrghvvghrrdgtohhmqeenucggtffrrghtthgvrhhnpeevveefve efueegffekkefhgeeiueffgfetueejvdfghfeujeejhfekjeelgedtgeenucevlhhushht vghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrughrihgrnhdrkhhlrg hvvghrsegrkhhlrghvvghrrdgtohhm X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 27 Feb 2023 14:38:35 -0500 (EST) Subject: Re: pg_get_functiondef(), trailing spaces and + sign To: Ron , pgsql-general References: <5e5c5f5f-7b98-fab1-ae9b-4072ee64058c@gmail.com> From: Adrian Klaver Message-ID: <99e9267e-a8a5-7c66-e708-35dd6e9db473@aklaver.com> Date: Mon, 27 Feb 2023 11:38:33 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 MIME-Version: 1.0 In-Reply-To: <5e5c5f5f-7b98-fab1-ae9b-4072ee64058c@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2/27/23 11:34 AM, Ron wrote: > Is there any direct way in Postgresql to get rid of the frankly > anti-useful junk at the end of each line (which also infects > pg_stat_activity.query), or must I resort to sed post-processing? \pset format unaligned > > > test=# select pg_get_functiondef(oid) > test-# from pg_proc > test-# where proname = 'foo'; >                  pg_get_functiondef > ---------------------------------------------------- >  CREATE OR REPLACE FUNCTION public.foo(bar integer)+ >   RETURNS double precision                         + >   LANGUAGE plpgsql                                 + >  AS $function$                                     + >  begin                                             + >      return bar * 1.0;                             + >  end;                                              + >  $function$                                        + > > (1 row) > > -- Adrian Klaver adrian.klaver@aklaver.com