Re: [PATCH] Add pg_get_tablespace_ddl() function to reconstruct CREATE TABLESPACE statement
Jim Jones <jim.jones@uni-muenster.de>
From: Jim Jones <jim.jones@uni-muenster.de>
To: Nishant Sharma <nishant.sharma@enterprisedb.com>
Cc: Manni Wood <manni.wood@enterprisedb.com>, pgsql-hackers@postgresql.org
Date: 2025-11-04T11:25:05Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Add infrastructure for pg_get_*_ddl functions
- 4881981f9202 19 (unreleased) landed
-
Add pg_get_tablespace_ddl() function
- b99fd9fd7f36 19 (unreleased) landed
-
Split out innards of pg_tablespace_location()
- 877a024902a7 19 (unreleased) landed
-
Remove spclocation field from pg_tablespace
- 16d8e594acd9 9.2.0 cited
Hi Nishant On 04/11/2025 11:37, Nishant Sharma wrote: > 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. Would you also say that having a pg_tablespace_size(oid) has no benefit? I took a look at similar functions, and the only pattern I could identify is that all of them take an oid parameter. pg_tablespace_size: oid and name pg_tablespace_location: oid has_tablespace_privilege: oid, name, and text pg_tablespace_databases: oid ... pg_get_tablespace_ddl: name I'm definitely not opposed to having just a name parameter, but I thought it would be worth mentioning. Best, Jim