-
Notifications
You must be signed in to change notification settings - Fork 180
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Encoding bug, still not out of the woods ... #275
Labels
Comments
This bug crashes pg_activity if there are a lot of queries with regexp or newlines. select '123' ~ '\d+', pg_sleep(3);
select 'Hello world!\n', pg_sleep(3) Not sure if it is the best solution, but manually escaping '\' to '\\' in all queries with a cast to -- fails:
convert_from(a.query::bytea, coalesce(pg_catalog.pg_encoding_to_char(b.encoding), 'UTF8')) AS query
-- fixes the problem:
convert_from(replace(a.query, '\', '\\')::bytea, coalesce(pg_catalog.pg_encoding_to_char(b.encoding), 'UTF8')) AS query |
blogh
added a commit
to blogh/pg_activity
that referenced
this issue
May 5, 2022
pg_activity crashes when queries use newlines or regexp as show in issue dalibo#275 This fix replaces single \ characters with double \ in the blocking, waiting and activity queries.
blogh
added a commit
to blogh/pg_activity
that referenced
this issue
May 5, 2022
pg_activity crashes when queries use newlines or regexp as show in issue dalibo#275 This fix replaces single \ characters with double \ in the blocking, waiting and activity queries.
blogh
added a commit
to blogh/pg_activity
that referenced
this issue
May 5, 2022
pg_activity crashes when queries use newlines or regexp as show in issue dalibo#275 This fix replaces single \ characters with double \ in the blocking, waiting and activity queries.
blogh
added a commit
that referenced
this issue
May 5, 2022
pg_activity crashes when queries use newlines or regexp as show in issue #275 This fix replaces single \ characters with double \ in the blocking, waiting and activity queries.
Thanks for the contribution. |
blogh
added a commit
to blogh/pg_activity
that referenced
this issue
Sep 16, 2022
Breaking change: * Attr 18.1 is required Change log: * Add more information to the header (instance and process stats) (Tests by @Krysztophe) * Add the --refresh option to the cli to set the refresh rate (dalibo#293) (Requested by @crysman) * Add the --debug-file option to enable logging (still mostly unused) * Add hints about runtime disabled features (dalibo#300) (Reported by @rutchkiwi) * The SUPERUSER privilege is not longer required (dalibo#277) (Requested by @Raymondmax) Bug fixes: * Add the --no-walreceiver to disable wal receiver stats for Aurora (dalibo#301) (Reported by @grutz) * Add the --no-tempfiles option to disable temp file statistics and add it to the --rds command (dalibo#303) (Reported by @adityabaradwaj) * Fix server information queries for v12/v13 (Reported and fixed by @kmoppel-cognite) * Fix InvalidTextRepresentation errors (dalibo#275) (Fix proposed by @ssharunas) * Fix sort order for parallel queries (dalibo#297) (Reported and fixed by @kmoppel-cognite) * Doc fixes and packaging improvements (@kianmeng, @Vampouille)
Merged
blogh
added a commit
that referenced
this issue
Sep 16, 2022
Breaking change: * Attr 18.1 is required Change log: * Add more information to the header (instance and process stats) (Tests by @Krysztophe) * Add the --refresh option to the cli to set the refresh rate (#293) (Requested by @crysman) * Add the --debug-file option to enable logging (still mostly unused) * Add hints about runtime disabled features (#300) (Reported by @rutchkiwi) * The SUPERUSER privilege is not longer required (#277) (Requested by @Raymondmax) Bug fixes: * Add the --no-walreceiver to disable wal receiver stats for Aurora (#301) (Reported by @grutz) * Add the --no-tempfiles option to disable temp file statistics and add it to the --rds command (#303) (Reported by @adityabaradwaj) * Fix server information queries for v12/v13 (Reported and fixed by @kmoppel-cognite) * Fix InvalidTextRepresentation errors (#275) (Fix proposed by @ssharunas) * Fix sort order for parallel queries (#297) (Reported and fixed by @kmoppel-cognite) * Doc fixes and packaging improvements (@kianmeng, @Vampouille)
blogh
added a commit
to blogh/pg_activity
that referenced
this issue
Sep 16, 2022
Breaking change: * Attr 18.1 is required Change log: * Add more information to the header (instance and process stats) (Tests by @Krysztophe) * Add the --refresh option to the cli to set the refresh rate (dalibo#293) (Requested by @crysman) * Add the --debug-file option to enable logging (still mostly unused) * Add hints about runtime disabled features (dalibo#300) (Reported by @rutchkiwi) * The SUPERUSER privilege is not longer required (dalibo#277) (Requested by @Raymondmax) Bug fixes: * Add the --no-walreceiver to disable wal receiver stats for Aurora (dalibo#301) (Reported by @grutz) * Add the --no-tempfiles option to disable temp file statistics and add it to the --rds command (dalibo#303) (Reported by @adityabaradwaj) * Fix server information queries for v12/v13 (Reported and fixed by @kmoppel-cognite) * Fix InvalidTextRepresentation errors (dalibo#275) (Fix proposed by @ssharunas) * Fix sort order for parallel queries (dalibo#297) (Reported and fixed by @kmoppel-cognite) * Doc fixes and packaging improvements (@kianmeng, @Vampouille)
blogh
added a commit
to blogh/pg_activity
that referenced
this issue
Jan 10, 2023
This test will ensure we still to handle queries without throwing this exception : psycopg2.errors.InvalidTextRepresentation: invalid input syntax for type bytea
blogh
added a commit
to blogh/pg_activity
that referenced
this issue
Jan 10, 2023
This test will ensure we still to handle queries without throwing this exception : psycopg2.errors.InvalidTextRepresentation: invalid input syntax for type bytea
blogh
added a commit
to blogh/pg_activity
that referenced
this issue
Jan 10, 2023
This test will ensure we still to handle queries without throwing this exception : psycopg2.errors.InvalidTextRepresentation: invalid input syntax for type bytea
Closed
blogh
added a commit
that referenced
this issue
Jan 23, 2023
This test will ensure we still to handle queries without throwing this exception : psycopg2.errors.InvalidTextRepresentation: invalid input syntax for type bytea
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
We had some encoding issues there : #149.
Well we're not out of the woods yet ... there are still some edge cases (at least one) .
In psql :
Quickly :
It's because of this part of the queries pg_get_activity*.sql:
In order for the cast to work, the '' should be escaped:
The text was updated successfully, but these errors were encountered: