Re: BUG #18746: /src/backend/parser/parse_utilcmd.c

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: dan-eli(at)mail(dot)ru, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #18746: /src/backend/parser/parse_utilcmd.c
Date: 2024-12-09 14:33:28
Message-ID: 202412091433.cg4ae6bd7fjr@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On 2024-Dec-09, PG Bug reporting form wrote:

> Dynamic memory, referenced by 'colname', is allocated at ruleutils.c:3587 by
> calling function 'deparse_expression' at parse_utilcmd.c:4061 and lost at
> parse_utilcmd.c:4100.

I think this refers to transformPartitionBound() which calls
deparse_expression(). I don't think a memory leak here is very
interesting, because this is DDL code which should be called in a
short-lived memory context, so it's freed soon afterwards. (I bet you
could find thousands of cases of similar situations elsewhere in the DDL
code.)

Indeed, transformPartitionBound is only called by DefineRelation (used
to create a table or similar) or transformPartitionCmd, which is called
for ALTER TABLE ... ATTACH/DETACH PARTITION.

--
Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/
"The problem with the future is that it keeps turning into the present"
(Hobbes)

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2024-12-09 15:50:56 Re: BUG #18742: /src/backend/rewrite/rewriteHandler.c
Previous Message Tomas Vondra 2024-12-09 14:27:40 Re: [BUGS] BUG #10123: Weird entries in pg_stat_activity