Create prepared statements via libpq instead of SQL #2118
rustprooflabs
started this conversation in
Ideas
Replies: 1 comment 1 reply
-
Looking at that function I forsee one possible problem: You have to define the parameter types using |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Would it be possible to change how prepared statements are created in osm2pgsql? They currently are created using SQL statements. I'd like to suggest switching to use
libpq PGPrepare
instead.An example of a current command from
properties.cpp
shows the SQL approach.Use case
I'm suggesting this change because this appears to be the last blocking issue preventing using osm2pgsql with pgBouncer. Now that pgBouncer v1.21 is out with support for prepared statements, it should be possible to use. Just not with statements prepared via SQL queries. From the pgBouncer docs:
Possible approach
It seems to me that functions could be added similar to
exec_prepared_internal
/exec_prepared_with_result_format
to usPGPrepare
. Are there known reasons why this wouldn't work or would be a net negative impact? I'd be willing to try writing a PR to make this change. I'm not very experienced with C++ but think I can at least get a PoC out there if that'd be helpful.Beta Was this translation helpful? Give feedback.
All reactions