-
Notifications
You must be signed in to change notification settings - Fork 66
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Description
It seems, queries are truncated to pg_stat_monitor.pgsm_query_max_len bytes, not characters, as stated in docs. It leads to text corruption when a tracked query contains symbols encoded with 2+ bytes in UTF-8 (cyrillic, for example), producing the invalid byte sequence for encoding... error on SELECT.
Expected Results
Queries should be truncated by characters count and support all languages.
Actual Results
ERROR: invalid byte sequence for encoding "UTF8": 0xd1
Version
percona/percona-distribution-postgresql:16.11
Steps to reproduce
-- Install and configure pg_stat_monitor
CREATE EXTENSION pg_stat_monitor;
ALTER SYSTEM SET pg_stat_monitor.pgsm_query_max_len = 1024;
-- Restart postgres to apply configs...
-- Reproduce
CREATE TABLE test
(
t text
);
INSERT INTO test
VALUES ('(((рррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррррр');
SELECT query
FROM pg_stat_monitor
WHERE query LIKE 'INSERT%';
-- ERROR: invalid byte sequence for encoding "UTF8": 0xd1
Relevant logs
Code of Conduct
- I agree to follow Percona Community Code of Conduct
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working