I have a regular case where I run many Postgres queries within a do/begin/end block
DO $$
BEGIN
<queries>
END $$;
In some cases, the databases and queries run a little bit slow and we need visibility to estimate how long the transaction will take and see any problems along the way.
Does there exist a build in postgres way to see which individual query within the transaction is being executed?
-
Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.Community– Community Bot2023年04月14日 04:40:55 +00:00Commented Apr 14, 2023 at 4:40
1 Answer 1
The only thing that comes to my mind is to run something like this before each query:
RAISE NOTICE 'Now executing query number 42';
Such messages are reported to the client immediately.
-
This is a perfect solution for our case. Thank youHendy– Hendy2023年04月18日 03:38:57 +00:00Commented Apr 18, 2023 at 3:38