---
name: cloud-sql-postgres-data-5ab68386ec96
description: Use these skills when you need to explore the database structure, discover schema objects like views or stored procedures, and execute custom SQL queries to interact with your data.
---

## Usage

All scripts can be executed using Node.js. Replace `<param_name>` and `<param_value>` with actual values.

**Bash:**
`node <skill_dir>/scripts/<script_name>.js '{"<param_name>": "<param_value>"}'`

**PowerShell:**
`node <skill_dir>/scripts/<script_name>.js '{\"<param_name>\": \"<param_value>\"}'`

Note: The scripts automatically load the environment variables from various .env files. Do not ask the user to set vars unless skill executions fails due to env var absence.


## Scripts


### execute_sql

Use this tool to execute a single SQL statement.

#### Parameters

| Name | Type | Description | Required | Default |
| :--- | :--- | :--- | :--- | :--- |
| sql | string | The sql to execute. | Yes |  |


---

### list_indexes

Lists available user indexes in the database, excluding system schemas (pg_catalog, information_schema). For each index, the following properties are returned: schema name, table name, index name, index type (access method), a boolean indicating if it's a unique index, a boolean indicating if it's for a primary key, the index definition, index size in bytes, the number of index scans, the number of index tuples read, the number of table tuples fetched via index scans, and a boolean indicating if the index has been used at least once.

#### Parameters

| Name | Type | Description | Required | Default |
| :--- | :--- | :--- | :--- | :--- |
| schema_name | string | Optional: a text to filter results by schema name. The input is used within a LIKE clause. | No | `` |
| table_name | string | Optional: a text to filter results by table name. The input is used within a LIKE clause. | No | `` |
| index_name | string | Optional: a text to filter results by index name. The input is used within a LIKE clause. | No | `` |
| only_unused | boolean | Optional: If true, only returns indexes that have never been used. | No | `false` |
| limit | integer | Optional: The maximum number of rows to return. Default is 50 | No | `50` |


---

### list_schemas

Lists all schemas in the database ordered by schema name and excluding system and temporary schemas. It returns the schema name, schema owner, grants, number of functions, number of tables and number of views within each schema.

#### Parameters

| Name | Type | Description | Required | Default |
| :--- | :--- | :--- | :--- | :--- |
| schema_name | string | Optional: A specific schema name pattern to search for. | No | `` |
| owner | string | Optional: A specific schema owner name pattern to search for. | No | `` |
| limit | integer | Optional: The maximum number of schemas to return. | No | `10` |


---

### list_sequences

Lists sequences in the database. 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 the sequence in the current session

#### Parameters

| Name | Type | Description | Required | Default |
| :--- | :--- | :--- | :--- | :--- |
| schema_name | string | Optional: A specific schema name pattern to search for. | No | `` |
| sequence_name | string | Optional: A specific sequence name pattern to search for. | No | `` |
| limit | integer | Optional: The maximum number of rows to return. Default is 50 | No | `50` |


---

### list_stored_procedure

Retrieves stored procedure metadata returning schema name, procedure name, procedure owner, language, definition, and description, filtered by optional role name (procedure owner), schema name, and limit (default 20).

#### Parameters

| Name | Type | Description | Required | Default |
| :--- | :--- | :--- | :--- | :--- |
| role_name | string | Optional: The owner name to filter the stored procedures by. Defaults to NULL. | No |  |
| schema_name | string | Optional: The schema name to filter the stored procedures by. Defaults to NULL. | No |  |
| limit | integer | Optional: The maximum number of stored procedures to return. Defaults to 20. | No | `20` |


---

### list_tables

Lists detailed schema information (object type, columns, constraints, indexes, triggers, owner, comment) as JSON for user-created tables (ordinary or partitioned). Filters by a comma-separated list of names. If names are omitted, lists all tables in user schemas.

#### Parameters

| Name | Type | Description | Required | Default |
| :--- | :--- | :--- | :--- | :--- |
| table_names | string | Optional: A comma-separated list of table names. If empty, details for all tables will be listed. | No | `` |
| output_format | string | Optional: Use 'simple' for names only or 'detailed' for full info. | No | `detailed` |


---

### list_triggers

Lists all non-internal triggers in a database. Returns trigger name, schema name, table name, whether its enabled or disabled, timing (e.g BEFORE/AFTER of the event), the  events that cause the trigger to fire such as INSERT, UPDATE, or DELETE, whether the trigger activates per ROW or per STATEMENT, the handler function executed by the trigger and full definition.

#### Parameters

| Name | Type | Description | Required | Default |
| :--- | :--- | :--- | :--- | :--- |
| trigger_name | string | Optional: A specific trigger name pattern to search for. | No | `` |
| schema_name | string | Optional: A specific schema name pattern to search for. | No | `` |
| table_name | string | Optional: A specific table name pattern to search for. | No | `` |
| limit | integer | Optional: The maximum number of rows to return. | No | `50` |


---

### list_views

Lists views in the database from pg_views with a default limit of 50 rows. Returns schemaname, viewname, ownername and the definition.

#### Parameters

| Name | Type | Description | Required | Default |
| :--- | :--- | :--- | :--- | :--- |
| view_name | string | Optional: A specific view name to search for. | No | `` |
| schema_name | string | Optional: A specific schema name to search for. | No | `` |
| limit | integer | Optional: The maximum number of rows to return. | No | `50` |


---



---
Source attribution: 420company
Original project: https://github.com/420company/artemis/blob/6fcd9f8e3045e30712e24a177f6d8d63d06cbb5d/skill-packs/cco/developers/cco-cloud-sql-postgresql-cloud-sql-postgres-data/SKILL.md
License: MIT
License information: https://opensource.org/license/mit
Original upstream instructions; downloaded from Dave AI.

## Upstream license notice

MIT License

Copyright (c) 2026 420.COMPANY

This software is open source and free for everyone.
Fork it. Improve it. Make it yours.
Pull requests, ideas, and contributions are always welcome.

https://github.com/420company/artemis

---

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.



# Dave AI resource metadata

Creator / publisher: 420company
Original project: https://github.com/420company/artemis/blob/6fcd9f8e3045e30712e24a177f6d8d63d06cbb5d/skill-packs/cco/developers/cco-cloud-sql-postgresql-cloud-sql-postgres-data/SKILL.md
Attribution basis: Source repository record

Fields of work: Data & Analytics, Development & Engineering, Operations
Roles: Data Analyst, Data Scientist, Backend Developer, Database Administrator, Business Process Analyst
Specialties: Database
Tools: PostgreSQL
Country applicability: Country not specified
Classification basis: Source category, role and specialization labels
Instruction SHA-256: 9186d45789797f9453128fe9b35186098f2b83ec5c6a83436fb7ff282e877253
