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

From: Nishant Sharma <nishant(dot)sharma(at)enterprisedb(dot)com>
To: Jim Jones <jim(dot)jones(at)uni-muenster(dot)de>
Cc: Manni Wood <manni(dot)wood(at)enterprisedb(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [PATCH] Add pg_get_tablespace_ddl() function to reconstruct CREATE TABLESPACE statement
Date: 2025-11-04 10:37:14
Message-ID: CADrsxdZaeN5OGKd3ON5Ba83cieM4fpuo-dEr08w_99Rub3=9tA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Nov 4, 2025 at 1:58 PM Jim Jones <jim(dot)jones(at)uni-muenster(dot)de> wrote:

>
> Do you think that an overload in pg_proc.dat with oid as parameter would
> make sense here? e.g.
>
> { oid => '2322',
> descr => 'total disk space usage for the specified tablespace',
> proname => 'pg_tablespace_size', provolatile => 'v', prorettype =>
> 'int8',
> proargtypes => 'oid', prosrc => 'pg_tablespace_size_oid' },
> { oid => '2323',
> descr => 'total disk space usage for the specified tablespace',
> proname => 'pg_tablespace_size', provolatile => 'v', prorettype =>
> 'int8',
> proargtypes => 'name', prosrc => 'pg_tablespace_size_name' },
>
> Using name as parameter is more user friendly than OID.
Because users usually do not know the oids. Constructing
the DDL from the name appears better as it contains a name
in it. So, no gain in having an OID version of
pg_get_tablespace_ddl.

PFA, v3 patch set. It has some cosmetic changes and few
improvements in the new code added by Manni in v2. Also, the
new test case added did not have a DROP statement for the
tablespace created, which caused make-world failure. So, I
corrected that too.

Regards,
Nishant Sharma.
EDB, Pune.

Attachment Content-Type Size
v3-0001-Adds-pg_get_tablespace_ddl-function.patch application/octet-stream 13.1 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ashutosh Bapat 2025-11-04 10:58:55 Re: Report bytes and transactions actually sent downtream
Previous Message Richard Guo 2025-11-04 10:02:18 Re: Teaching planner to short-circuit empty UNION/EXCEPT/INTERSECT inputs