pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Ron <ronljohnsonjr@gmail.com>
To: pgsql-general <pgsql-general@postgresql.org>
Subject: Re: pg_get_functiondef(), trailing spaces and + sign
Date: Mon, 27 Feb 2023 11:38:33 -0800
Message-ID: <99e9267e-a8a5-7c66-e708-35dd6e9db473@aklaver.com> (raw)
In-Reply-To: <5e5c5f5f-7b98-fab1-ae9b-4072ee64058c@gmail.com>
References: <5e5c5f5f-7b98-fab1-ae9b-4072ee64058c@gmail.com>

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





view thread (4+ messages)  latest in thread

Message-ID: <99e9267e-a8a5-7c66-e708-35dd6e9db473@aklaver.com>
Permalink:  ../99e9267e-a8a5-7c66-e708-35dd6e9db473@aklaver.com/
Also on:    postgresql.org/message-id/99e9267e-a8a5-7c66-e708-35dd6e9db473@aklaver.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: adrian.klaver@aklaver.com, ronljohnsonjr@gmail.com
  Subject: Re: pg_get_functiondef(), trailing spaces and + sign
  In-Reply-To: <99e9267e-a8a5-7c66-e708-35dd6e9db473@aklaver.com>
  References: <5e5c5f5f-7b98-fab1-ae9b-4072ee64058c@gmail.com> <99e9267e-a8a5-7c66-e708-35dd6e9db473@aklaver.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox