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 1pWjMB-0003Z4-5t for pgsql-general@arkaria.postgresql.org; Mon, 27 Feb 2023 19:40:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pWjMA-0007IG-2A for pgsql-general@arkaria.postgresql.org; Mon, 27 Feb 2023 19:40:18 +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 1pWjM9-0007I7-Ny for pgsql-general@lists.postgresql.org; Mon, 27 Feb 2023 19:40:17 +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 1pWjM3-0004Li-9E for pgsql-general@postgresql.org; Mon, 27 Feb 2023 19:40:17 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 40C045C007C; Mon, 27 Feb 2023 14:40:10 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Mon, 27 Feb 2023 14:40:10 -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=1677526810; x= 1677613210; bh=KDg+dn/QGxBU0XRINcoQAXY7MJRxlYeX7uqy9xmjH/o=; b=Z tMfaKhFnsAJ1f81gy3YUsnjCk8auQkCYVDUR9rW5Q8yjbhB+AfmsSROfoEiDA8k2 bE8fAdRi5ftwgAc0I+NTkTF46797PzlWTBoKK1uwCdgOtSNX5+Y7GcqSNORs4CJf lsMj377MMt3hkGmU/j7NrvmwYW1k4WZD0i9AxhZAw7R1lZYw2IoSapJjMq5oqz3I HOjIR8iaZ8B9neUtMf0YOrSWmD0ZEMk7LrD95IEvr4BcktmTVVDp8NPof9EZpUSC 2jPopPfdkDC8ZuwPpurOiuo4BDaVNPF2i7BGSzK/y1oOu3QaTsO69Vmtgof6kKVB eub9ShSkAdQL8BFa1lTTw== 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=1677526810; x=1677613210; bh=K Dg+dn/QGxBU0XRINcoQAXY7MJRxlYeX7uqy9xmjH/o=; b=isFST03DoXwL4iEfi 7AZ2B3r68hNh2zXdZSPZ5jkNtB++SnlKzJqAKuNZf8lf49Ocl771gIuOm5u0HHWa eTogPjSr2JgfLm3NltLC/QBMbkYjQ32eWYtRcOzMQSecjYV8H5b9G7o+KKdAjItT xpq1LG6x8qYDpbO8w4I3e7EenNcdMad62wBo9Aov4IpIKntaZq3gocF4/sW+TiTj gsEwWZyjW3tN68oW9C4xfMPY43whi7F3+hAJp0n+jxpStJOTStsi/SCamahABCXD vbG13Rz5n1uT/hXPzDd97MyTVGN0N6CqvIAHlNVx28HgP49VgOFgtcjPRwg9sYDY ZJfQQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrudeltddguddvfecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhepuffvfhfhkffffgggjggtgfesth ekredttdefjeenucfhrhhomheptegurhhirghnucfmlhgrvhgvrhcuoegrughrihgrnhdr khhlrghvvghrsegrkhhlrghvvghrrdgtohhmqeenucggtffrrghtthgvrhhnpeevveefve efueegffekkefhgeeiueffgfetueejvdfghfeujeejhfekjeelgedtgeenucevlhhushht vghrufhiiigvpedunecurfgrrhgrmhepmhgrihhlfhhrohhmpegrughrihgrnhdrkhhlrg hvvghrsegrkhhlrghvvghrrdgtohhm X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 27 Feb 2023 14:40:09 -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: <8a54a6aa-3dde-8662-382d-a810b6d000c7@aklaver.com> Date: Mon, 27 Feb 2023 11:40:08 -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? > > Or \ef foo > 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