Skip to content

Commit ac1540b

Browse files
committed
refactor(postgres): remove duplicate PostgreSQL_get_prepared_transactions function
The function was duplicated in the codebase with slightly different implementations. Removing the redundant version to maintain code cleanliness and avoid confusion.
1 parent 3db07fd commit ac1540b

1 file changed

Lines changed: 0 additions & 33 deletions

File tree

postgres_server.py

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -4298,22 +4298,6 @@ async def PostgreSQL_get_lock_waits() -> List[Dict[str, Any]]:
42984298
rows = await execute_query(query)
42994299
return rows
43004300

4301-
@mcp.tool()
4302-
async def PostgreSQL_get_prepared_transactions() -> List[Dict[str, Any]]:
4303-
"""Get information about prepared transactions (two-phase commit)."""
4304-
query = """
4305-
SELECT
4306-
gid as transaction_id,
4307-
prepared,
4308-
owner,
4309-
database
4310-
FROM pg_prepared_xacts
4311-
ORDER BY prepared
4312-
"""
4313-
4314-
rows = await execute_query(query)
4315-
return rows
4316-
43174301
@mcp.tool()
43184302
async def PostgreSQL_list_foreign_tables_detailed() -> List[Dict[str, Any]]:
43194303
"""Get detailed information about foreign tables and their servers."""
@@ -5046,23 +5030,6 @@ async def PostgreSQL_get_index_usage_stats() -> List[Dict[str, Any]]:
50465030
rows = await execute_query(query)
50475031
return rows
50485032

5049-
@mcp.tool()
5050-
async def PostgreSQL_get_prepared_transactions() -> List[Dict[str, Any]]:
5051-
"""Get information about currently prepared transactions (two-phase commit)."""
5052-
query = """
5053-
SELECT
5054-
gid as transaction_id,
5055-
prepared as prepared_time,
5056-
owner,
5057-
database,
5058-
EXTRACT(epoch FROM (now() - prepared)) as seconds_since_prepared
5059-
FROM pg_prepared_xacts
5060-
ORDER BY prepared ASC
5061-
"""
5062-
5063-
rows = await execute_query(query)
5064-
return rows
5065-
50665033
@mcp.tool()
50675034
async def PostgreSQL_get_replication_stats() -> List[Dict[str, Any]]:
50685035
"""Get replication slot and standby server statistics."""

0 commit comments

Comments
 (0)