Re: BUG #16743: psql doesn't show whole expression in stored column

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>, turon(dot)david(at)seznam(dot)cz, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #16743: psql doesn't show whole expression in stored column
Date: 2020-11-25 16:42:40
Message-ID: 20201125164240.GA26300@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Wed, Nov 25, 2020 at 11:15:39AM -0500, Tom Lane wrote:
> I wrote:
> > Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com> writes:
> >> I think we should get rid of the truncating. Otherwise, there is no way
> >> to actually get the full information, is there? (Other than pg_dump or
> >> manual catalog queries.)
>
> > That'd be okay with me. It's always seemed a little odd that we do that
> > for attrdefs but not anything else.
>
> Here's a proposed patch for that.
>
> After looking a bit closer, I saw that the memory leak I was worried
> about before is not real, because the code passes mustfree = true to
> printTableAddCell. However, I still don't like it one bit, because you
> need some undocumented and fragile assumptions about the relationship
> between attidentity and attgenerated to conclude that we won't instead
> have a false free() attempt on something that mustn't be free'd. So I
> think we should adjust the code to track mustfree explicitly, as done
> below.
>
> Should we back-patch this? I think that the truncation behavior became
> significantly more of a problem with the addition of the GENERATED
> feature; before that it was clearer what was going on. So I'm mildly
> inclined to back-patch to v12 where that came in.

Works for me.

--
Bruce Momjian <bruce(at)momjian(dot)us> https://momjian.us
EnterpriseDB https://enterprisedb.com

The usefulness of a cup is in its emptiness, Bruce Lee

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Stas Obydionnov 2020-11-25 19:23:02 Re: BUG #16744: ts_headline behaves incorrectly with <-> and proximity operators
Previous Message Tom Lane 2020-11-25 16:15:39 Re: BUG #16743: psql doesn't show whole expression in stored column