BUG #17957: psql-16beta1 \df+ does not show the function body

Started by PG Bug reporting formover 3 years ago4 messagesbugs
Beta feature

Hackorum builds and tests every patch posted to the lists, not only commitfest submissions. This is Hackorum's own CI rather than the PostgreSQL project's, and it is still under testing - please report anything that looks wrong.

won't retrysuccessCI history

You can run a PostgreSQL built from this patch straight from Docker, with no checkout and no build:

docker run --rm -p 5432:5432 ghcr.io/hackorum-dev/postgres-patch:t71946
psql -h localhost -U postgres

Built from patchset v4 (message #4), August 18, 2026 at 03:24 PM.

Every patchset is also pushed to a branch of our PostgreSQL fork, so you can check out the same tree CI built. Without a PostgreSQL checkout:

git clone --branch t71946_4 https://github.com/hackorum-dev/postgres.git

In a checkout you already have, add the fork once:

git remote add hackorum https://github.com/hackorum-dev/postgres.git

then, for this patchset and every later one:

git fetch hackorum t71946_4 && git checkout t71946_4

Patchset v4 (message #4) is on t71946_4

Jump to latest
#1PG Bug reporting form
noreply@postgresql.org

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 |

#2Bruce Momjian
bruce@momjian.us
In reply to: PG Bug reporting form (#1)
Re: BUG #17957: psql-16beta1 \df+ does not show the function body

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: /messages/by-id/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.

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Bruce Momjian (#2)
Re: BUG #17957: psql-16beta1 \df+ does not show the function body

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

#4Bruce Momjian
bruce@momjian.us
In reply to: Tom Lane (#3)
Re: BUG #17957: psql-16beta1 \df+ does not show the function body

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:

t71946_4
master.difftext/x-diff; charset=us-asciiDownload+15-0