There's more...

Output from strace can be somewhat esoteric, especially as it limits the content length by default to increase readability. If we want to really capture a lot of data with extreme verbosity that will help a human make a diagnosis, we need to increase the string length. For strace, the parameter for that is -s. If we wanted to greatly extend the length of the string output, we can do that with this command:

strace -p 4200 -s 2000

Then, if we execute the following query:

SELECT 'This is a very long query to view.'; 

We would see this output:

recvfrom(11, "Q\0\0\0001select 'This is a very long query to  view.';\0", 8192, 0, NULL, NULL) = 50 

Instead of this:

 recvfrom(11, "Q\0\0\0001select 'This is a very long"..., 8192, 0, ...

Get PostgreSQL High Availability Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.