Re: [HACKERS] Suggesting a libpq addition

2010-12-27 Thread Andrew Chernow
to consider libpqtypes for contrib (which we don't have time for atm). ... or as a libpq sibling :) -- Andrew Chernow eSilo, LLC every bit counts http://www.esilo.com/ -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postg

Re: [HACKERS] Suggesting a libpq addition

2010-12-27 Thread Merlin Moncure
On Mon, Dec 27, 2010 at 4:21 PM, Bruce Momjian wrote: > Dmitriy Igrishin wrote: >> IMO, it would be better to implement some utility functions to >> make it easy to construct arrays dynamically for PQexecParams >> and PQexecPrepared. This seems to me more universal solution >> and it is useful for

Re: [HACKERS] Suggesting a libpq addition

2010-12-27 Thread Bruce Momjian
Dmitriy Igrishin wrote: > IMO, it would be better to implement some utility functions to > make it easy to construct arrays dynamically for PQexecParams > and PQexecPrepared. This seems to me more universal solution > and it is useful for both -- high level libpq-libraries authors and for > those w

Re: [HACKERS] Suggesting a libpq addition

2010-12-06 Thread Dmitriy Igrishin
2010/12/6 Andrew Chernow > On 12/6/2010 11:40 AM, Dmitriy Igrishin wrote: > >> IMO, it would be better to implement some utility functions to >> make it easy to construct arrays dynamically for PQexecParams >> and PQexecPrepared. This seems to me more universal solution >> and it is useful for bo

Re: [HACKERS] Suggesting a libpq addition

2010-12-06 Thread Andrew Chernow
On 12/6/2010 11:40 AM, Dmitriy Igrishin wrote: IMO, it would be better to implement some utility functions to make it easy to construct arrays dynamically for PQexecParams and PQexecPrepared. This seems to me more universal solution and it is useful for both -- high level libpq-libraries authors

Re: [HACKERS] Suggesting a libpq addition

2010-12-06 Thread Dmitriy Igrishin
IMO, it would be better to implement some utility functions to make it easy to construct arrays dynamically for PQexecParams and PQexecPrepared. This seems to me more universal solution and it is useful for both -- high level libpq-libraries authors and for those who like to use libpq directly. 20

Re: [HACKERS] Suggesting a libpq addition

2010-12-06 Thread Andrew Chernow
That would be a *HUGE* piece of software compared the relatively small thing I am suggesting... Sometimes complex and large solutions are required for the simplest of ideas. I believe this is one of those cases. You can't solve the "printf style PQexec" properly by merely implementing a

Re: [HACKERS] Suggesting a libpq addition

2010-12-06 Thread Kenneth Marshall
On Mon, Dec 06, 2010 at 10:14:55AM -0500, Merlin Moncure wrote: > On Mon, Dec 6, 2010 at 9:55 AM, Marc Balmer wrote: > > Am 06.12.10 15:37, schrieb Merlin Moncure: > >> On Sun, Dec 5, 2010 at 5:10 AM, Magnus Hagander > >> wrote: > >>> On Sun, Dec 5, 2010 at 10:22, Marc Balmer wrote: > I am

Re: [HACKERS] Suggesting a libpq addition

2010-12-06 Thread Merlin Moncure
On Mon, Dec 6, 2010 at 9:55 AM, Marc Balmer wrote: > Am 06.12.10 15:37, schrieb Merlin Moncure: >> On Sun, Dec 5, 2010 at 5:10 AM, Magnus Hagander wrote: >>> On Sun, Dec 5, 2010 at 10:22, Marc Balmer wrote: I am suggesting adding a function to libpq: PGresult *PQvexec(PGconn *conn

Re: [HACKERS] Suggesting a libpq addition

2010-12-06 Thread Marc Balmer
Am 06.12.10 15:37, schrieb Merlin Moncure: > On Sun, Dec 5, 2010 at 5:10 AM, Magnus Hagander wrote: >> On Sun, Dec 5, 2010 at 10:22, Marc Balmer wrote: >>> I am suggesting adding a function to libpq: >>> >>> PGresult *PQvexec(PGconn *conn, const char *fmt, ...); >>> >>> It behaves similar to PQex

Re: [HACKERS] Suggesting a libpq addition

2010-12-06 Thread Merlin Moncure
On Sun, Dec 5, 2010 at 5:10 AM, Magnus Hagander wrote: > On Sun, Dec 5, 2010 at 10:22, Marc Balmer 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 > >

Re: [HACKERS] Suggesting a libpq addition

2010-12-05 Thread Dmitriy Igrishin
Hey Andrew, No, thanks. :-) And I don't think that libpq should follows it (libpqtypes). 2010/12/6 Andrew Chernow > > A varargs version of PQexecParams() would be handy, though. Imagine being >> able >> to do: >> >> PQexecVParams("SELECT * FROM mytable WHERE foo = $1 AND bar = $2", foovar, >>

Re: [HACKERS] Suggesting a libpq addition

2010-12-05 Thread Andrew Chernow
A varargs version of PQexecParams() would be handy, though. Imagine being able to do: PQexecVParams("SELECT * FROM mytable WHERE foo = $1 AND bar = $2", foovar, barvar); instead of constructing an array for the variables. http://libpqtypes.esilo.com/man3/PQexecf.html -- Andrew Chernow eSi

Re: [HACKERS] Suggesting a libpq addition

2010-12-05 Thread Andrew Chernow
On 12/5/2010 4:22 AM, Marc Balmer 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 does connection re-establishing if the connection fails (it can be discussed if th

Re: [HACKERS] Suggesting a libpq addition

2010-12-05 Thread Dmitriy Igrishin
Hey hackers, Varargs-exec is useful only when programmer calls it directly. It is useless when libpq is used to create a more flexible high-level library (e.g., for C++). PQexecParams (PQexecPrepared) are good for it. What about auto reconnect. There are PQreset already and PG_CONNECTION_OK (_BAD

Re: [HACKERS] Suggesting a libpq addition

2010-12-05 Thread Magnus Hagander
On Sun, Dec 5, 2010 at 11:57, Heikki Linnakangas wrote: > On 05.12.2010 12:10, Magnus Hagander wrote: >> >> On Sun, Dec 5, 2010 at 10:22, Marc Balmer  wrote: >>> >>> I am suggesting adding a function to libpq: >>> >>> PGresult *PQvexec(PGconn *conn, const char *fmt, ...); >>> >>> It behaves simila

Re: [HACKERS] Suggesting a libpq addition

2010-12-05 Thread Marc Balmer
Am 05.12.2010 um 11:57 schrieb Heikki Linnakangas : > On 05.12.2010 12:10, Magnus Hagander wrote: >> On Sun, Dec 5, 2010 at 10:22, Marc Balmer wrote: >>> I am suggesting adding a function to libpq: >>> >>> PGresult *PQvexec(PGconn *conn, const char *fmt, ...); >>> >>> It behaves similar to P

Re: [HACKERS] Suggesting a libpq addition

2010-12-05 Thread Heikki Linnakangas
On 05.12.2010 12:10, Magnus Hagander wrote: On Sun, Dec 5, 2010 at 10:22, Marc Balmer 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

Re: [HACKERS] Suggesting a libpq addition

2010-12-05 Thread Magnus Hagander
On Sun, Dec 5, 2010 at 10:22, Marc Balmer 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()?

Re: [HACKERS] Suggesting a libpq addition

2010-12-05 Thread Pavel Stehule
2010/12/5 Marc Balmer : > 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 > does connection re-establishing if the connection fails (it can be > discussed if this alre

[HACKERS] Suggesting a libpq addition

2010-12-05 Thread Marc Balmer
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 does connection re-establishing if the connection fails (it can be discussed if this already to much magic, maybe remove this