count_rows
Count rows in a PostgreSQL table with an optional WHERE filter. Returns an exact count without row data.
Instructions
Count rows in a PostgreSQL table, optionally filtered by a WHERE clause.
Exact, unlike the estimates from list_tables, and returns no row data.
Args: table: Table name. where: Optional WHERE clause body without the WHERE keyword, e.g. "status = 'active'". schema: Schema name. Defaults to the session schema, then 'public'. database: Database name. Defaults to the session database.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| table | Yes | ||
| where | No | ||
| schema | No | ||
| database | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |