pg.ddx.io pgsql-general@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pg_get_functiondef(), trailing spaces and + sign 4+ messages / 3 participants [nested] [flat]
* pg_get_functiondef(), trailing spaces and + sign @ 2023-02-27 19:34 Ron <ronljohnsonjr@gmail.com> 2023-02-27 19:38 ` Re: pg_get_functiondef(), trailing spaces and + sign Adrian Klaver <adrian.klaver@aklaver.com> 2023-02-27 19:40 ` Re: pg_get_functiondef(), trailing spaces and + sign Adrian Klaver <adrian.klaver@aklaver.com> 0 siblings, 2 replies; 4+ messages in thread From: Ron @ 2023-02-27 19:34 UTC (permalink / raw) To: pgsql-general 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. ^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: pg_get_functiondef(), trailing spaces and + sign 2023-02-27 19:34 pg_get_functiondef(), trailing spaces and + sign Ron <ronljohnsonjr@gmail.com> @ 2023-02-27 19:38 ` Adrian Klaver <adrian.klaver@aklaver.com> 1 sibling, 0 replies; 4+ messages in thread From: Adrian Klaver @ 2023-02-27 19:38 UTC (permalink / raw) To: Ron <ronljohnsonjr@gmail.com>; 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 ^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: pg_get_functiondef(), trailing spaces and + sign 2023-02-27 19:34 pg_get_functiondef(), trailing spaces and + sign Ron <ronljohnsonjr@gmail.com> @ 2023-02-27 19:40 ` Adrian Klaver <adrian.klaver@aklaver.com> 2023-02-27 22:40 ` Re: pg_get_functiondef(), trailing spaces and + sign Kirk Wolak <wolakk@gmail.com> 1 sibling, 1 reply; 4+ messages in thread From: Adrian Klaver @ 2023-02-27 19:40 UTC (permalink / raw) To: Ron <ronljohnsonjr@gmail.com>; 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? > > 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 ^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: pg_get_functiondef(), trailing spaces and + sign 2023-02-27 19:34 pg_get_functiondef(), trailing spaces and + sign Ron <ronljohnsonjr@gmail.com> 2023-02-27 19:40 ` Re: pg_get_functiondef(), trailing spaces and + sign Adrian Klaver <adrian.klaver@aklaver.com> @ 2023-02-27 22:40 ` Kirk Wolak <wolakk@gmail.com> 0 siblings, 0 replies; 4+ messages in thread From: Kirk Wolak @ 2023-02-27 22:40 UTC (permalink / raw) To: Adrian Klaver <adrian.klaver@aklaver.com>; +Cc: Ron <ronljohnsonjr@gmail.com>; pgsql-general On Mon, Feb 27, 2023 at 2:40 PM Adrian Klaver <adrian.klaver@aklaver.com> wrote: > 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 > that will edit the function, I think he meant \sf foo which will show you the content of the function! > > 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 > > > ^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2023-02-27 22:40 UTC | newest] Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2023-02-27 19:34 pg_get_functiondef(), trailing spaces and + sign Ron <ronljohnsonjr@gmail.com> 2023-02-27 19:38 ` Adrian Klaver <adrian.klaver@aklaver.com> 2023-02-27 19:40 ` Adrian Klaver <adrian.klaver@aklaver.com> 2023-02-27 22:40 ` Kirk Wolak <wolakk@gmail.com>
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