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 1pWjGg-0003B1-Ge for pgsql-general@arkaria.postgresql.org; Mon, 27 Feb 2023 19:34:38 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pWjGe-00044T-Ky for pgsql-general@arkaria.postgresql.org; Mon, 27 Feb 2023 19:34:36 +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 1pWjGe-000442-8W for pgsql-general@lists.postgresql.org; Mon, 27 Feb 2023 19:34:36 +0000 Received: from mail-qv1-xf36.google.com ([2607:f8b0:4864:20::f36]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pWjGc-0004Ik-4I for pgsql-general@postgresql.org; Mon, 27 Feb 2023 19:34:35 +0000 Received: by mail-qv1-xf36.google.com with SMTP id nf5so5241950qvb.5 for ; Mon, 27 Feb 2023 11:34:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:subject:from:content-language:to :user-agent:mime-version:date:message-id:from:to:cc:subject:date :message-id:reply-to; bh=th63n7Sc/WTj8/KFFgAgna7yAFx6lfj7O14VMKctQ3c=; b=eGPEZsIwK60YzTw7muK/zjLbju7nyJvtOKrtoXMUxE10gAO7d3lw52SJt8v70UWzUR znCyssMvfQA8U+DZ8FBAE0XZPOHZB8FDPv3Fin+zwkL3KWHmmRXoTD4OkEQXluNzioLB 50tmbtnUPqG4VRnf9NLI9lEfPPiqnOfdOExSDMpO82OKJCsHCywX2pRHfnkQS+yXKeEH PxdbXZPM0l+EtdsDtJxoiL1lsn3+451r5N9BhHFt/ONg6pwDJNaLsyhXYGrQN2LHDKBt vWk9Rq9GAdgggsH5cRtc3ltIm/Xb48OujVBjz14LkXisIVklT7n5h9Kbl5QGWaTHuDuY ulnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:subject:from:content-language:to :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=th63n7Sc/WTj8/KFFgAgna7yAFx6lfj7O14VMKctQ3c=; b=WlRU0Yl8Xn05r+mPoM3fZQerTJJW91Ip2hxM0rY++YFDdWwK26dia748Eo83gw0bn2 +n5b2dBwm/A6RS4909rNaAL6HLf0+TbTCIr0Steo1ZGH5jJLh5SEedOOFV6FPbNzxh1L 1jCJ+Q6Etm/IzaVPgJSbeia5fXjTp2bGTt0SfbBjdCKFZQY/E34NfdIiZZRlMXg68RXD KcYBP9zFL2ScVRcXJB0ZptJjlug/ojfp9l+swX2tu/ZC6eHb4SKsTAUhOHbH75tlHtOW Mok31VNJwKPjFEI8Kk+FaldD5paWZ6hGAkhQf4e2d5uB9g0xbd7Kb1m0zx0mYbUxThgn VR5w== X-Gm-Message-State: AO0yUKV+34YlutbY85uJJi2IdEGuI0+i9KJLD4e6OdMzpGcL8+82qSDs 9fZTzr9I7SisuUsV62CEIeGV6UyMu3w= X-Google-Smtp-Source: AK7set+NaXFw7B+ClBVYFefT5hJGAy4rJu0fml8muWPKOm22ddqVh24UB6eMuyduYeF8D0YKF+bICw== X-Received: by 2002:a05:6214:f09:b0:537:727f:ac28 with SMTP id gw9-20020a0562140f0900b00537727fac28mr1274639qvb.27.1677526471589; Mon, 27 Feb 2023 11:34:31 -0800 (PST) Received: from ?IPV6:2600:1700:bd2c:b810::43? ([2600:1700:bd2c:b810::43]) by smtp.googlemail.com with ESMTPSA id w18-20020a05620a129200b0073b8459d221sm5423843qki.31.2023.02.27.11.34.30 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 27 Feb 2023 11:34:31 -0800 (PST) Message-ID: <5e5c5f5f-7b98-fab1-ae9b-4072ee64058c@gmail.com> Date: Mon, 27 Feb 2023 13:34:30 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 To: pgsql-general Content-Language: en-US From: Ron Subject: pg_get_functiondef(), trailing spaces and + sign Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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? 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) -- Born in Arizona, moved to Babylonia.