Search Database Objects by Name
pg_search_objectsSearch database objects by name pattern across schemas and types. Find tables, views, functions, indexes, sequences, constraints, and triggers using SQL LIKE wildcards.
Instructions
Search across all database objects (tables, views, functions, indexes, sequences, constraints) by name pattern.
Args:
pattern: Case-insensitive name pattern, supports SQL LIKE wildcards: % (any chars), _ (one char) (required)
object_types: Filter by object type — 'table', 'view', 'function', 'index', 'sequence', 'constraint', 'trigger' (optional, searches all types by default)
schema: Limit search to a specific schema (optional)
response_format: Output format
Returns: JSON: { matches: SearchResult[], count: number } Markdown: grouped results by type
Examples:
pattern: "user%" → all objects starting with "user"
pattern: "%order%" → all objects containing "order"
pattern: "idx_%" with object_types: ["index"] → all indexes
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pattern | Yes | LIKE pattern, e.g. "user%" or "%order%" | |
| object_types | No | Object types to search (optional, searches all types by default) | |
| schema | No | Limit to a specific schema (optional) | |
| response_format | No | Output format: 'markdown' for human-readable, 'json' for machine-readable | markdown |