Re: pg_get_functiondef(), trailing spaces and + sign - Mailing list pgsql-general

From Adrian Klaver
Subject Re: pg_get_functiondef(), trailing spaces and + sign
Date
Msg-id 99e9267e-a8a5-7c66-e708-35dd6e9db473@aklaver.com
Whole thread Raw
In response to pg_get_functiondef(), trailing spaces and + sign  (Ron <ronljohnsonjr@gmail.com>)
List pgsql-general
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



pgsql-general by date:

Previous
From: Ron
Date:
Subject: pg_get_functiondef(), trailing spaces and + sign
Next
From: Adrian Klaver
Date:
Subject: Re: pg_get_functiondef(), trailing spaces and + sign