postgres-list-tablespaces Tool
The “postgres-list-tablespaces” tool lists tablespaces in a Postgres database.
less than a minute
About
The postgres-list-tablespaces tool lists available tablespaces in the database.
postgres-list-tablespaces lists detailed information as JSON for tablespaces. The tool takes the following input parameters:
tablespace_name(optional): A text to filter results by tablespace name. Default:""limit(optional): The maximum number of tablespaces to return. Default:50
Compatible Sources
This tool can be used with the following database sources:
| Source Name |
|---|
| PostgreSQL Source |
| AlloyDB for PostgreSQL Source |
| Cloud SQL for PostgreSQL Source |
Example
kind: tools
name: list_tablespaces
type: postgres-list-tablespaces
source: postgres-source
description: |
Lists all tablespaces in the database. Returns the tablespace name,
owner name, size in bytes(if the current user has CREATE privileges on
the tablespace, otherwise NULL), internal object ID, the access control
list regarding permissions, and any specific tablespace options.
The response is a json array with the following elements:
{
"tablespace_name": "name of the tablespace",
"owner_username": "owner of the tablespace",
"size_in_bytes": "size in bytes if the current user has CREATE privileges on the tablespace, otherwise NULL",
"oid": "Object ID of the tablespace",
"spcacl": "Access privileges",
"spcoptions": "Tablespace-level options (e.g., seq_page_cost, random_page_cost)"
}
Reference
| field | type | required | description |
|---|---|---|---|
| type | string | true | Must be “postgres-list-tablespaces”. |
| source | string | true | Name of the source the SQL should execute on. |
| description | string | false | Description of the tool that is passed to the agent. |
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.