High-risk tools in PostgreSQL MCP Server
43 of the 274 tools in PostgreSQL MCP Server are classified as high risk. This page profiles those tools specifically, with recommended policy actions and the attack patterns that target them.
Every operation listed below is an action PolicyLayer recommends controlling at the transport layer. Open any tool to see the full profile, risk score, and YAML policy snippet.
Tools at high risk
-
pg_analyzeExecuteUpdate table statistics for the query planner.
-
pg_analyze_query_indexesExecuteAnalyze a specific query for index recommendations using EXPLAIN ANALYZE.
-
pg_bufferExecuteCreate a buffer zone around geometries. Default limit: 10 rows, default simplify: 10m (set simplify: 0 to disable). Simplification reduces polygon point count for LLM-friendly p...
-
pg_cancel_backendExecuteCancel a running query (graceful, preferred over terminate).
-
pg_clusterExecutePhysically reorder table data based on an index. Call with no args to re-cluster all previously-clustered tables.
-
pg_cron_create_extensionExecuteEnable the pg_cron extension for job scheduling. Requires superuser privileges.
-
pg_cron_scheduleExecuteSchedule a new cron job. Supports standard cron syntax (e.g.,
-
pg_cron_schedule_in_databaseExecuteSchedule a cron job to run in a different database. Useful for cross-database maintenance tasks. Returns the job ID.
-
pg_explain_analyzeExecuteRun query and show actual execution plan with timing.
-
pg_geo_clusterExecutePerform spatial clustering using DBSCAN or K-Means. DBSCAN defaults: eps=100m, minPoints=3. K-Means default: numClusters=5 (provide explicit value for best results).
-
pg_geo_transformExecuteTransform geometry from one spatial reference system (SRID) to another.
-
pg_geometry_transformExecuteTransform a WKT or GeoJSON geometry from one SRID to another. Common SRIDs: 4326 (WGS84/GPS), 3857 (Web Mercator).
-
pg_jsonb_arrayExecuteBuild a JSONB array from values. Accepts {values: [...]} or {elements: [...]}. Returns {array: [...]}.
-
pg_kcache_create_extensionExecuteEnable the pg_stat_kcache extension for OS-level performance metrics. Requires pg_stat_statements to be installed first. Both extensions must be in shared_preload_libraries.
-
pg_ltree_create_extensionExecuteEnable the ltree extension for hierarchical tree-structured labels.
-
pg_migration_applyExecuteExecute migration SQL and record it atomically in a single transaction.
-
pg_partman_create_extensionExecuteEnable the pg_partman extension for automated partition management. Requires superuser privileges.
-
pg_partman_run_maintenanceExecuteRun partition maintenance to create new child partitions and enforce retention policies. Should be executed regularly (e.g., via pg_cron) to keep partitions current. Maintains a...
-
pg_pgcrypto_create_extensionExecuteEnable the pgcrypto extension for cryptographic functions.
-
pg_pgcrypto_cryptExecuteHash a password using crypt() with a salt from gen_salt().
-
pg_pgcrypto_decryptExecuteDecrypt data that was encrypted with pg_pgcrypto_encrypt.
-
pg_pgcrypto_encryptExecuteEncrypt data using PGP symmetric encryption.
-
pg_pgcrypto_gen_random_uuidExecuteGenerate a cryptographically secure UUID v4.
-
pg_pgcrypto_gen_saltExecuteGenerate a salt for use with crypt() password hashing.
-
pg_pgcrypto_hmacExecuteCompute HMAC for data with a secret key.
-
pg_postgis_create_extensionExecuteEnable the PostGIS extension for geospatial operations.
-
pg_reindexExecuteRebuild indexes to improve performance. For target: database, name defaults to the current database if omitted.
-
pg_reload_confExecuteReload PostgreSQL configuration without restart.
-
pg_restore_commandExecuteGenerate pg_restore command for restoring backups.
-
pg_role_setExecuteSet the session
-
pg_security_auditExecuteRun a comprehensive security audit checking SSL, password encryption, superuser exposure, logging, and HBA rules.
-
pg_set_configExecuteSet a configuration parameter for the current session.
-
pg_stats_running_totalExecuteCalculate cumulative running total (SUM OVER) for a numeric column. Use partitionBy to reset total per group.
-
pg_transaction_beginExecuteBegin a new transaction. Returns a transaction ID for subsequent operations.
-
pg_transaction_executeExecuteExecute multiple statements atomically in a single transaction.
-
pg_vacuumExecuteRun VACUUM to reclaim storage and update visibility map. Use analyze: true to also update statistics. Verbose output goes to PostgreSQL server logs.
-
pg_vacuum_analyzeExecuteRun VACUUM and ANALYZE together for optimal performance. Verbose output goes to PostgreSQL server logs.
-
pg_vector_clusterExecutePerform K-means clustering on vectors. Returns cluster centroids only (not row assignments). To assign rows to clusters, compare row vectors to centroids using pg_vector_distance.
-
pg_vector_create_extensionExecuteEnable the pgvector extension for vector similarity search.
-
pg_vector_dimension_reduceExecuteReduce vector dimensions using random projection. Supports direct vector input OR table-based extraction.
-
pg_vector_embedExecuteGenerate text embeddings. Returns a simple hash-based embedding for demos (use external APIs for production).
-
pg_vector_normalizeExecuteNormalize a vector to unit length.
-
pg_vector_performanceExecuteAnalyze vector search performance and index effectiveness. Provide testVector for benchmarking (recommended).
Attacks that target this class
High-risk tools in any server share these documented attack patterns. Each links to the full case and the defensive policy.