0

Queries of multiple schemas of DB are logged in the pg_log directory in an application server, and the performance of specific schema needs to be profiled.

The same queries that are running, the difference is that search_path is set to include different schemas in each case.

How to log queries using a specific in pg_log? Or is there any way to "tail" specific the log for queries using a specific schema on the command line?

2
  • How do queries relate to schemas? Commented Mar 15, 2019 at 8:50
  • Meant that S1,S2 are two schemas in DB1.In general, queries related to schemas are logged after "SET SESSION search_path TO 'S1'" and "SET SESSION search_path TO 'S2'" respectively in pg_log.right?Requirement is monitoring schema 'S2' ( queries after SET SESSION search_path TO 'S2' alone) alone. @LaurenzAlbe Commented Mar 15, 2019 at 9:14

1 Answer 1

1

There is no way to do that.

What you could do is use different users to run the queries with different search_path settings, and then only log queries by a certain user:

ALTER ROLE myuser SET log_min_duration_statement = 0;
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.