modified: backend/src/services/SqlExecutor.ts
This commit is contained in:
@@ -56,9 +56,19 @@ export class SqlExecutor {
|
||||
|
||||
// Execute with retry mechanism
|
||||
const result = await this.retryQuery(async () => {
|
||||
// Check search_path and backend PID for debugging
|
||||
const debugResult = await pool.query('SELECT current_setting(\'search_path\') as search_path, pg_backend_pid() as pid, inet_server_addr() as server_ip');
|
||||
console.log('[SQL Debug] search_path:', debugResult.rows[0]?.search_path, 'pid:', debugResult.rows[0]?.pid, 'server_ip:', debugResult.rows[0]?.server_ip);
|
||||
// Check session info for debugging
|
||||
const debugResult = await pool.query(`
|
||||
SELECT
|
||||
current_setting('search_path') as search_path,
|
||||
pg_backend_pid() as pid,
|
||||
inet_server_addr() as server_ip,
|
||||
current_user as cur_user,
|
||||
session_user as sess_user,
|
||||
current_setting('role') as role,
|
||||
current_setting('transaction_isolation') as isolation
|
||||
`);
|
||||
const d = debugResult.rows[0];
|
||||
console.log('[SQL Debug] pid:', d?.pid, 'cur_user:', d?.cur_user, 'sess_user:', d?.sess_user, 'role:', d?.role, 'isolation:', d?.isolation);
|
||||
|
||||
const queryResult = await pool.query(sqlQuery, params);
|
||||
console.log('[SQL Result] rowCount:', queryResult.rowCount, 'rows:', JSON.stringify(queryResult.rows).substring(0, 500));
|
||||
|
||||
Reference in New Issue
Block a user