Re: [PATCH] Add pg_get_tablespace_ddl() function to reconstruct CREATE TABLESPACE statement

From: Jim Jones <jim(dot)jones(at)uni-muenster(dot)de>
To: Manni Wood <manni(dot)wood(at)enterprisedb(dot)com>, Nishant Sharma <nishant(dot)sharma(at)enterprisedb(dot)com>
Cc: Álvaro Herrera <alvherre(at)kurilemu(dot)de>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [PATCH] Add pg_get_tablespace_ddl() function to reconstruct CREATE TABLESPACE statement
Date: 2025-11-07 16:16:38
Message-ID: 8a95ff30-daaf-48f7-8100-dbfb90baa6a3@uni-muenster.de
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 07/11/2025 02:27, Manni Wood wrote:
> Attached v7 fixes problems in tests due to whitespace.

Since get_tablespace_loc_string returns a palloc'd string, I guess you
could pfree it after the if block. The same applies for spcowner, since
you're calling GetUserNameFromId() with noerr = false.

For reference, see pg_get_indexdef_worker():

...
/*
* If it has options, append "WITH (options)"
*/
str = flatten_reloptions(indexrelid);
if (str)
{
appendStringInfo(&buf, " WITH (%s)", str);
pfree(str);
}
...

Thanks

Best, Jim

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jelte Fennema-Nio 2025-11-07 16:19:56 Re: Decouple C++ support in Meson's PGXS from LLVM enablement
Previous Message Tom Lane 2025-11-07 16:07:35 Re: CI: Add task that runs pgindent