Re: Willing to fix a PQexec() in libpq module

2019-03-19 Thread Andres Freund
Hi, On 2019-03-20 02:19:54 +, Wu, Fei wrote: > Hi, thanks for all replies. > According to all your discussions, Maybe the problems is that > 1) keep modifications just in client side; > 2) modifications VS client current applications > > Maybe we could create a new function(May called PQexecS

RE: Willing to fix a PQexec() in libpq module

2019-03-19 Thread Wu, Fei
Message- From: Daniel Verite [mailto:dan...@manitou-mail.org] Sent: Wednesday, March 20, 2019 3:08 AM To: Tom Lane Cc: Kyotaro HORIGUCHI ; Wu, Fei/吴 非 ; pgsql-hack...@postgresql.org Subject: Re: Willing to fix a PQexec() in libpq module Tom Lane wrote: > Unfortunately, if the defa

Re: Willing to fix a PQexec() in libpq module

2019-03-19 Thread Daniel Verite
Tom Lane wrote: > Unfortunately, if the default behavior doesn't change, then there's little > argument for doing this at all. The security reasoning behind doing > anything in this area would be to provide an extra measure of protection > against SQL-injection attacks on carelessly-writt

Re: Willing to fix a PQexec() in libpq module

2019-03-19 Thread Tom Lane
Andres Freund writes: > On 2019-03-19 13:18:25 -0400, Tom Lane wrote: >> Having said that ... a better argument for a new API is that it >> could be explicitly designed to handle multiple queries, and in >> particular make some provision for returning multiple PGresults. > Oh, I completely agree,

Re: Willing to fix a PQexec() in libpq module

2019-03-19 Thread David Fetter
On Tue, Mar 19, 2019 at 01:18:25PM -0400, Tom Lane wrote: > Andres Freund writes: > > On 2019-03-19 13:59:34 -0300, Alvaro Herrera wrote: > >> I suppose it can be argued that for the cases where they want that, it > >> is not entirely ridiculous to have it be done with a different API call, > >> s

Re: Willing to fix a PQexec() in libpq module

2019-03-19 Thread Andres Freund
Hi, On 2019-03-19 13:18:25 -0400, Tom Lane wrote: > Having said that ... a better argument for a new API is that it > could be explicitly designed to handle multiple queries, and in > particular make some provision for returning multiple PGresults. Oh, I completely agree, that'd be hugely useful.

Re: Willing to fix a PQexec() in libpq module

2019-03-19 Thread Tom Lane
Andres Freund writes: > On 2019-03-19 13:59:34 -0300, Alvaro Herrera wrote: >> I suppose it can be argued that for the cases where they want that, it >> is not entirely ridiculous to have it be done with a different API call, >> say PQexecMultiple. > Sure, but what'd the gain be? Using PQexecPara

Re: Willing to fix a PQexec() in libpq module

2019-03-19 Thread Andres Freund
On 2019-03-19 10:02:33 -0700, Andres Freund wrote: > Hi, > > On 2019-03-19 13:59:34 -0300, Alvaro Herrera wrote: > > On 2019-Mar-19, Andres Freund wrote: > > > On 2019-03-19 12:51:39 -0400, Tom Lane wrote: > > > > David Fetter writes: > > > > > I think the answer is "no," and we should deprecate

Re: Willing to fix a PQexec() in libpq module

2019-03-19 Thread Andres Freund
Hi, On 2019-03-19 13:59:34 -0300, Alvaro Herrera wrote: > On 2019-Mar-19, Andres Freund wrote: > > On 2019-03-19 12:51:39 -0400, Tom Lane wrote: > > > David Fetter writes: > > > > I think the answer is "no," and we should deprecate this misfeature. > > > > It's bad enough that we'll be supporting

Re: Willing to fix a PQexec() in libpq module

2019-03-19 Thread David Fetter
On Tue, Mar 19, 2019 at 01:59:34PM -0300, Alvaro Herrera wrote: > On 2019-Mar-19, Andres Freund wrote: > > > Hi, > > > > On 2019-03-19 12:51:39 -0400, Tom Lane wrote: > > > David Fetter writes: > > > > I think the answer is "no," and we should deprecate this misfeature. > > > > It's bad enough t

Re: Willing to fix a PQexec() in libpq module

2019-03-19 Thread Alvaro Herrera
On 2019-Mar-19, Andres Freund wrote: > Hi, > > On 2019-03-19 12:51:39 -0400, Tom Lane wrote: > > David Fetter writes: > > > I think the answer is "no," and we should deprecate this misfeature. > > > It's bad enough that we'll be supporting it for five years after > > > deprecating it, but it's w

Re: Willing to fix a PQexec() in libpq module

2019-03-19 Thread Andres Freund
Hi, On 2019-03-19 12:51:39 -0400, Tom Lane wrote: > David Fetter writes: > > I think the answer is "no," and we should deprecate this misfeature. > > It's bad enough that we'll be supporting it for five years after > > deprecating it, but it's worse to leave it hanging around our necks > > foreve

Re: Willing to fix a PQexec() in libpq module

2019-03-19 Thread Tom Lane
David Fetter writes: > I think the answer is "no," and we should deprecate this misfeature. > It's bad enough that we'll be supporting it for five years after > deprecating it, but it's worse to leave it hanging around our necks > forever. https://en.wikipedia.org/wiki/Albatross_(metaphor) The pr

Re: Willing to fix a PQexec() in libpq module

2019-03-19 Thread David Fetter
On Tue, Mar 19, 2019 at 10:30:45AM -0400, Tom Lane wrote: > Kyotaro HORIGUCHI writes: > > At Tue, 19 Mar 2019 08:18:23 +, "Wu, Fei" > > wrote in > > <52E6E0843B9D774C8C73D6CF64402F05621F0FFC@G08CNEXMBPEKD02.g08.fujitsu.local> > >> I will try to fix it~ > > > I don't oppose that, but as the

Re: Willing to fix a PQexec() in libpq module

2019-03-19 Thread Tom Lane
Kyotaro HORIGUCHI writes: > At Tue, 19 Mar 2019 08:18:23 +, "Wu, Fei" > wrote in > <52E6E0843B9D774C8C73D6CF64402F05621F0FFC@G08CNEXMBPEKD02.g08.fujitsu.local> >> I will try to fix it~ > I don't oppose that, but as the discussion linked from there [1], > psql already has a feature that sen

Re: Willing to fix a PQexec() in libpq module

2019-03-19 Thread Kyotaro HORIGUCHI
Hello. At Tue, 19 Mar 2019 08:18:23 +, "Wu, Fei" wrote in <52E6E0843B9D774C8C73D6CF64402F05621F0FFC@G08CNEXMBPEKD02.g08.fujitsu.local> > Hi,all > > On website: https://wiki.postgresql.org/wiki/Todo#libpq > I found that in libpq module,there is a TODO case: >