pgbouncer-rr-patch | Adds query routing and rewriting extensions to pgbouncer | Browser Plugin library
kandi X-RAY | pgbouncer-rr-patch Summary
kandi X-RAY | pgbouncer-rr-patch Summary
Adds query routing and rewriting extensions to pgbouncer
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of pgbouncer-rr-patch
pgbouncer-rr-patch Key Features
pgbouncer-rr-patch Examples and Code Snippets
Community Discussions
Trending Discussions on pgbouncer-rr-patch
QUESTION
I am using pgbouncer-rr to do query rewrite in a redshift cluster (pgbouncer calls rewrite_query.py to do the rewrites and here is the link for more info on this project - https://github.com/awslabs/pgbouncer-rr-patch). Pgbouncer-rr is based on pgbouncer and its code is merged into pgbouncer and started. I have been using it successfully to rewrite queries, but I am running into an issue when I am trying to convert an insert statement into unload to external table.
The execution flow is pgbouncer -> rewrite.c -> pycall.c -> rewrite_query.py
In the python module I write the orig and converted sql and here is how it looks in the log - so python module is able to do the conversion without any issues.
...ANSWER
Answered 2019-Feb-07 at 21:14This was due to the python object type getting changed from str to Unicode. I am using sqlparse do to parsing and this module was converting the variable to unicode and was failing PyString_Check check. To fix the issue, after the call to sqlparse, I converted the encoding of the variable to ascii in python (version is 2.7.15) - varname.encode("ascii")
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install pgbouncer-rr-patch
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page