Re: Suggesting a libpq addition

Поиск
Список
Период
Сортировка
От Magnus Hagander
Тема Re: Suggesting a libpq addition
Дата
Msg-id AANLkTikpaEx=7iPOkRUmg15i=z9Dbb4HSYpr8D78qgWQ@mail.gmail.com
обсуждение исходный текст
Ответ на Suggesting a libpq addition  (Marc Balmer <marc@msys.ch>)
Ответы Re: Suggesting a libpq addition  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
Re: Suggesting a libpq addition  (Merlin Moncure <mmoncure@gmail.com>)
Список pgsql-hackers
On Sun, Dec 5, 2010 at 10:22, Marc Balmer <marc@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/


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Pavel Stehule
Дата:
Сообщение: Re: Suggesting a libpq addition
Следующее
От: Heikki Linnakangas
Дата:
Сообщение: Re: Suggesting a libpq addition