On Sun, Dec 5, 2010 at 10:22, Marc Balmer <m...@msys.ch> wrote: > I am suggesting adding a function to libpq: > > PGresult *PQvexec(PGconn *conn, const char *fmt, ...); > > It behaves similar to PQexec, but it allows for printf style varargs and
How is that not a horrible idea, compared to using PQexecParams()? You have to remember to do all your escaping and things manually, whereas PQexecParams() does it automatically. > does connection re-establishing if the connection fails (it can be > discussed if this already to much magic, maybe remove this part). It > has been carefully designed to handle memory the right way. We use this > since a long time. It certainly doesn't belong in a function like that - and in fact, I think reconnection has to be handled at a different layer anyway.What if the connection was in the middle of a transaction? Silently rolls it back without letting the app know, since it switched to a new one? -- Magnus Hagander Me: http://www.hagander.net/ Work: http://www.redpill-linpro.com/ -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers