modified: backend/src/services/SqlExecutor.ts
This commit is contained in:
@@ -56,19 +56,15 @@ export class SqlExecutor {
|
|||||||
|
|
||||||
// Execute with retry mechanism
|
// Execute with retry mechanism
|
||||||
const result = await this.retryQuery(async () => {
|
const result = await this.retryQuery(async () => {
|
||||||
// Check session info for debugging
|
// Check if connected to replica
|
||||||
const debugResult = await pool.query(`
|
const debugResult = await pool.query(`
|
||||||
SELECT
|
SELECT
|
||||||
current_setting('search_path') as search_path,
|
|
||||||
pg_backend_pid() as pid,
|
pg_backend_pid() as pid,
|
||||||
inet_server_addr() as server_ip,
|
pg_is_in_recovery() as is_replica,
|
||||||
current_user as cur_user,
|
inet_server_addr() as server_ip
|
||||||
session_user as sess_user,
|
|
||||||
current_setting('role') as role,
|
|
||||||
current_setting('transaction_isolation') as isolation
|
|
||||||
`);
|
`);
|
||||||
const d = debugResult.rows[0];
|
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);
|
console.log('[SQL Debug] pid:', d?.pid, 'is_replica:', d?.is_replica, 'server_ip:', d?.server_ip);
|
||||||
|
|
||||||
// Disable prepared statements by using unique name each time
|
// Disable prepared statements by using unique name each time
|
||||||
const queryResult = await pool.query({
|
const queryResult = await pool.query({
|
||||||
|
|||||||
Reference in New Issue
Block a user