pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #17957: psql-16beta1 \df+ does not show the function body
4+ messages / 3 participants
[nested] [flat]

Commits from this thread:
  2023-06-01 47b7051bc8  doc:  PG 16 relnotes, add psql \df+ source code change
* BUG #17957: psql-16beta1 \df+ does not show the function body
@ 2023-06-01 17:57  PG Bug reporting form <noreply@postgresql.org>
  0 siblings, 1 reply; 4+ messages in thread

From: PG Bug reporting form @ 2023-06-01 17:57 UTC (permalink / raw)
  To: pgsql-bugs@lists.postgresql.org; +Cc: bzm@2bz.de

The following bug has been logged on the website:

Bug reference:      17957
Logged by:          Boris Z
Email address:      bzm@2bz.de
PostgreSQL version: 16beta1
Operating system:   OSX, Linux
Description:        

Hi,

The release notes do not mention \df+. 
https://www.postgresql.org/docs/16/release-16.html#RELEASE-16-PSQL

for testing I used this function, but any user function will do.

CREATE OR REPLACE FUNCTION test_function()
RETURNS bigint
AS $$
    SELECT 1;
$$ LANGUAGE sql
STABLE
PARALLEL SAFE;

When using psql (16beta1)
=# \df+ test_function
-[ RECORD 1 ]-------+--------------
Schema              | public
Name                | test_function
Result data type    | bigint
Argument data types |
Type                | func
Volatility          | stable
Parallel            | safe
Owner               | bz
Security            | invoker
Access privileges   |
Language            | sql
Internal name       |
Description         |

using psql-15.3 it works as expected
=# \df+ test_function
-[ RECORD 1 ]-------+--------------
Schema              | public
Name                | test_function
Result data type    | bigint
Argument data types |
Type                | func
Volatility          | stable
Parallel            | safe
Owner               | bz
Security            | invoker
Access privileges   |
Language            | sql
Source code         |              +
                    |     SELECT 1;+
                    |
Description         |



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: BUG #17957: psql-16beta1 \df+ does not show the function body
@ 2023-06-01 19:23  Bruce Momjian <bruce@momjian.us>
  parent: PG Bug reporting form <noreply@postgresql.org>
  0 siblings, 1 reply; 4+ messages in thread

From: Bruce Momjian @ 2023-06-01 19:23 UTC (permalink / raw)
  To: bzm@2bz.de; pgsql-bugs@lists.postgresql.org

On Thu, Jun  1, 2023 at 05:57:19PM +0000, PG Bug reporting form wrote:
> The following bug has been logged on the website:
> 
> Bug reference:      17957
> Logged by:          Boris Z
> Email address:      bzm@2bz.de
> PostgreSQL version: 16beta1
> Operating system:   OSX, Linux
> Description:        
> 
> Hi,
> 
> The release notes do not mention \df+. 
> https://www.postgresql.org/docs/16/release-16.html#RELEASE-16-PSQL
> 
> for testing I used this function, but any user function will do.
> 
> CREATE OR REPLACE FUNCTION test_function()
> RETURNS bigint
> AS $$
>     SELECT 1;
> $$ LANGUAGE sql
> STABLE
> PARALLEL SAFE;
> 
> When using psql (16beta1)
> =# \df+ test_function
> -[ RECORD 1 ]-------+--------------
> Schema              | public
> Name                | test_function
> Result data type    | bigint
> Argument data types |
> Type                | func
> Volatility          | stable
> Parallel            | safe
> Owner               | bz
> Security            | invoker
> Access privileges   |
> Language            | sql
> Internal name       |
> Description         |
> 
> using psql-15.3 it works as expected
> =# \df+ test_function
> -[ RECORD 1 ]-------+--------------
> Schema              | public
> Name                | test_function
> Result data type    | bigint
> Argument data types |
> Type                | func
> Volatility          | stable
> Parallel            | safe
> Owner               | bz
> Security            | invoker
> Access privileges   |
> Language            | sql
> Source code         |              +
>                     |     SELECT 1;+
>                     |
> Description         |

We had this commit in PG 16:

	Author: Tom Lane <tgl@sss.pgh.pa.us>
	2023-03-02 [3dfae91f7] Show "internal name" not "source code" in psql's \df+ co
	
	    Show "internal name" not "source code" in psql's \df+ command.
	
	    Our previous habit of showing the full function body is really
	    pretty unfriendly for tabular viewing of functions, and now that
	    we have \sf and \ef commands there seems no good reason why \df+
	    has to do it.  It still seems to make sense to show prosrc for
	    internal and C-language functions, since in those cases prosrc
	    is just the C function name; but then let's rename the column to
	    "Internal name" which is a more accurate descriptor.
	
	    Isaac Morland
	
	    Discussion: https://postgr.es/m/CAMsGm5eqKc6J1=Lwn=ZONG=6ZDYWRQ4cgZQLqMuZGB1aVt_JBg@mail.gmail.com

I didn't think anyone would mind the change so I didn't document it in
the release notes --- should I?

-- 
  Bruce Momjian  <bruce@momjian.us>        https://momjian.us
  EDB                                      https://enterprisedb.com

  Only you can decide what is important to you.





^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: BUG #17957: psql-16beta1 \df+ does not show the function body
@ 2023-06-01 22:18  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Bruce Momjian <bruce@momjian.us>
  0 siblings, 1 reply; 4+ messages in thread

From: Tom Lane @ 2023-06-01 22:18 UTC (permalink / raw)
  To: Bruce Momjian <bruce@momjian.us>; +Cc: bzm@2bz.de; pgsql-bugs@lists.postgresql.org

Bruce Momjian <bruce@momjian.us> writes:
> On Thu, Jun  1, 2023 at 05:57:19PM +0000, PG Bug reporting form wrote:
>> The release notes do not mention \df+. 

> We had this commit in PG 16:
	
> 	    Show "internal name" not "source code" in psql's \df+ command.

> I didn't think anyone would mind the change so I didn't document it in
> the release notes --- should I?

I think it needs to be mentioned, since it's a nontrivial user-visible
behavioral change.  I'm not sure it's a compatibility item, but it
ought to be there somewhere.

			regards, tom lane





^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: BUG #17957: psql-16beta1 \df+ does not show the function body
@ 2023-06-02 00:00  Bruce Momjian <bruce@momjian.us>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 4+ messages in thread

From: Bruce Momjian @ 2023-06-02 00:00 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: bzm@2bz.de; pgsql-bugs@lists.postgresql.org

On Thu, Jun  1, 2023 at 06:18:09PM -0400, Tom Lane wrote:
> Bruce Momjian <bruce@momjian.us> writes:
> > On Thu, Jun  1, 2023 at 05:57:19PM +0000, PG Bug reporting form wrote:
> >> The release notes do not mention \df+. 
> 
> > We had this commit in PG 16:
> 	
> > 	    Show "internal name" not "source code" in psql's \df+ command.
> 
> > I didn't think anyone would mind the change so I didn't document it in
> > the release notes --- should I?
> 
> I think it needs to be mentioned, since it's a nontrivial user-visible
> behavioral change.  I'm not sure it's a compatibility item, but it
> ought to be there somewhere.

Added, patch attached.

-- 
  Bruce Momjian  <bruce@momjian.us>        https://momjian.us
  EDB                                      https://enterprisedb.com

  Only you can decide what is important to you.

Attachments:

master.diff (text/x-diff, 750B) download diff --git a/doc/src/sgml/release-16.sgml b/doc/src/sgml/release-16.sgml index af333d7b1e..d59f7cf46f 100644 --- a/doc/src/sgml/release-16.sgml +++ b/doc/src/sgml/release-16.sgml @@ -2163,6 +2163,21 @@ Add "FOREIGN" designation to psql \d+ for foreign table children and partitions </para> </listitem> +<!-- +Author: Tom Lane <tgl@sss.pgh.pa.us> +2023-03-02 [3dfae91f7] Show "internal name" not "source code" in psql's \df+ co +--> + +<listitem> +<para> +Prevent \df+ from showing function source code (Isaac Morland) +</para> + +<para> +Function bodies are more easily viewed with \ev and \ef. +</para> +</listitem> + <!-- Author: Peter Eisentraut <peter@eisentraut.org> 2022-11-15 [5b66de343] psql: Add command to use extended query protocol
^ permalink raw reply [nested|flat] 4+ messages in thread


end of thread, other threads:[~2023-06-02 00:00 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2023-06-01 17:57 BUG #17957: psql-16beta1 \df+ does not show the function body PG Bug reporting form <noreply@postgresql.org>
2023-06-01 19:23 ` Bruce Momjian <bruce@momjian.us>
2023-06-01 22:18   ` Tom Lane <tgl@sss.pgh.pa.us>
2023-06-02 00:00     ` Bruce Momjian <bruce@momjian.us>

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