Database Management

Long SQL Text truncation in PostgreSQL

This article provides information about the issue when the SQL Texts are being truncated for PostgreSQL DB instance

First published date

10/10/2022 8:51 AM

Last published date

10/10/2022 8:51 AM

Overview

In DPA, for PostgreSQL monitor instance, the long SQL Texts are being truncated and not showing completely

Product section

Database Performance Analyzer

Cause

The settings 'track_activity_query_size' in PostgreSQL instance is only set to 4096 or 4KB
This parameter determines the maximum query length to display in the pg_stat_activity query column

Resolution

Increase the size for 'track_activity_query_size' parameter in PostgreSQL Instance

To increase the size
  • Create a copy of postgresql.cnf (For a quick backup)
  • Edit postgresql.cnf 
  • Find  'track_activity_query_size' parameter and increase the size to 16384 byte or 16KB
  • Restart PostgreSQL service *Required*