postgres-list-sequences Tool
The “postgres-list-sequences” tool lists sequences in a Postgres database.
2 minute read
About
The postgres-list-sequences tool retrieves information about sequences in a
Postgres database.
postgres-list-sequences lists detailed information as JSON for all sequences.
The tool takes the following input parameters:
sequence_name(optional): A text to filter results by sequence name. The input is used within a LIKE clause. Default:""schema_name(optional): A text to filter results by schema name. The input is used within a LIKE clause. Default:""limit(optional): The maximum number of rows 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_indexes
type: postgres-list-sequences
source: postgres-source
description: |
Lists all the sequences in the database ordered by sequence name.
Returns sequence name, schema name, sequence owner, data type of the
sequence, starting value, minimum value, maximum value of the sequence,
the value by which the sequence is incremented, and the last value
generated by generated by the sequence in the current session.
The response is a json array with the following elements:
{
"sequence_name": "sequence name",
"schema_name": "schema name",
"sequence_owner": "owner of the sequence",
"data_type": "data type of the sequence",
"start_value": "starting value of the sequence",
"min_value": "minimum value of the sequence",
"max_value": "maximum value of the sequence",
"increment_by": "increment value of the sequence",
"last_value": "last value of the sequence"
}
Reference
| field | type | required | description |
|---|---|---|---|
| type | string | true | Must be “postgres-list-sequences”. |
| 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.