Get tablespace DDL
get_tablespace_ddlRetrieve the SQL definition (DDL) of a PostgreSQL tablespace using PG 19's internal function. Returns the CREATE statement or indicates if not found.
Instructions
Return the CREATE TABLESPACE DDL for a named tablespace using PG 19's pg_get_tablespacedef(oid) function. Returns found=false with an empty ddl when the tablespace doesn't exist. Requires PG 19+. Returns an object with object_type ('tablespace'), object_name, found, and ddl.
Example: get_tablespace_ddl(tablespace_name='fast_ssd')
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| database | No | Optional: target a configured secondary (read-only) database by name; omit for the primary. Call list_databases to see the configured ids. | |
| tablespace_name | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ddl | Yes | ||
| found | Yes | ||
| object_name | Yes | ||
| object_type | Yes |