Re: [HACKERS] Proposal: RETURNING primary_key()

2016-04-03 Thread David G. Johnston
On Sun, Apr 3, 2016 at 9:49 PM, Igal @ Lucee.org wrote: > On 4/3/2016 4:34 PM, Dave Cramer wrote: > > > On 4/3/2016 8:21 AM, Dave Cramer wrote: > >> >> I'd like to turn this question around. Are there good reasons to use -ng >> over pgjdbc ? >> >> As to your question, you may be

Re: [HACKERS] Proposal: RETURNING primary_key()

2016-04-03 Thread Igal @ Lucee.org
On 4/3/2016 4:34 PM, Dave Cramer wrote: On 4/3/2016 8:21 AM, Dave Cramer wrote: I'd like to turn this question around. Are there good reasons to use -ng over pgjdbc ? As to your question, you may be interested to know that pgjdbc is more performant than ng. That's good

Re: [HACKERS] Proposal: RETURNING primary_key()

2016-04-03 Thread Dave Cramer
On 3 April 2016 at 22:20, Stephen Frost wrote: > * Craig Ringer (cr...@2ndquadrant.com) wrote: > > On 4 April 2016 at 10:13, Dave Cramer wrote: > > > Async notification is the easier part, I wasn't aware that the ssl > library > > > had this problem

Re: [HACKERS] Proposal: RETURNING primary_key()

2016-04-03 Thread Stephen Frost
* Craig Ringer (cr...@2ndquadrant.com) wrote: > On 4 April 2016 at 10:13, Dave Cramer wrote: > > Async notification is the easier part, I wasn't aware that the ssl library > > had this problem though > > AFAIK the issue is that even if there are bytes available on the

Re: [HACKERS] Proposal: RETURNING primary_key()

2016-04-03 Thread Stephen Frost
Dave, * Dave Cramer (p...@fastcrypt.com) wrote: > On 3 April 2016 at 21:56, Stephen Frost wrote: > > * Dave Cramer (p...@fastcrypt.com) wrote: > > > On 3 April 2016 at 15:35, Stephen Frost wrote: > > > > Not generally much of a JDBC user myself, but the

Re: [HACKERS] Proposal: RETURNING primary_key()

2016-04-03 Thread Craig Ringer
On 4 April 2016 at 10:13, Dave Cramer wrote: > Async notification is the easier part, I wasn't aware that the ssl library > had this problem though > > AFAIK the issue is that even if there are bytes available on the underlying socket, the SSL lib doesn't know if that means

Re: [HACKERS] Proposal: RETURNING primary_key()

2016-04-03 Thread Dave Cramer
On 3 April 2016 at 21:56, Stephen Frost wrote: > Dave, > > * Dave Cramer (p...@fastcrypt.com) wrote: > > On 3 April 2016 at 15:35, Stephen Frost wrote: > > > Not generally much of a JDBC user myself, but the inability to avoid > > > polling for LISTEN

Re: [HACKERS] Proposal: RETURNING primary_key()

2016-04-03 Thread Stephen Frost
Dave, * Dave Cramer (p...@fastcrypt.com) wrote: > On 3 April 2016 at 15:35, Stephen Frost wrote: > > Not generally much of a JDBC user myself, but the inability to avoid > > polling for LISTEN notifications is a pretty big annoyance, which I just > > ran into with a client.

Re: [HACKERS] Proposal: RETURNING primary_key()

2016-04-03 Thread Dave Cramer
On 3 April 2016 at 12:18, Igal @ Lucee.org wrote: > On 4/3/2016 8:21 AM, Dave Cramer wrote: > > > On 9 March 2016 at 20:49, Craig Ringer wrote: > >> On 3/8/2016 5:12 PM, Craig Ringer wrote: >> >>> >>> Are there good reasons to use pgjdbc over pgjdbc-ng

Re: [HACKERS] Proposal: RETURNING primary_key()

2016-04-03 Thread Dave Cramer
On 3 April 2016 at 15:35, Stephen Frost wrote: > * Dave Cramer (p...@fastcrypt.com) wrote: > > On 9 March 2016 at 20:49, Craig Ringer wrote: > > > > > On 10 March 2016 at 00:41, Igal @ Lucee.org wrote: > > > > > >> On 3/8/2016 5:12 PM,

Re: [HACKERS] Proposal: RETURNING primary_key()

2016-04-03 Thread Stephen Frost
* Dave Cramer (p...@fastcrypt.com) wrote: > On 9 March 2016 at 20:49, Craig Ringer wrote: > > > On 10 March 2016 at 00:41, Igal @ Lucee.org wrote: > > > >> On 3/8/2016 5:12 PM, Craig Ringer wrote: > >> > >>> One of the worst problems (IMO) is in the driver

Re: [HACKERS] Proposal: RETURNING primary_key()

2016-04-03 Thread Igal @ Lucee.org
On 4/3/2016 8:21 AM, Dave Cramer wrote: On 9 March 2016 at 20:49, Craig Ringer > wrote: On 3/8/2016 5:12 PM, Craig Ringer wrote: Are there good reasons to use pgjdbc over pgjdbc-ng then? Maturity, support for older

Re: [HACKERS] Proposal: RETURNING primary_key()

2016-04-03 Thread Dave Cramer
On 9 March 2016 at 20:49, Craig Ringer wrote: > On 10 March 2016 at 00:41, Igal @ Lucee.org wrote: > >> On 3/8/2016 5:12 PM, Craig Ringer wrote: >> >>> One of the worst problems (IMO) is in the driver architecture its self. >>> It attempts to prevent

Re: [HACKERS] Proposal: RETURNING primary_key()

2016-03-12 Thread Gavin Flower
On 12/03/16 23:27, Michael Paquier wrote: On Fri, Mar 11, 2016 at 5:28 AM, Craig Ringer wrote: On 11 March 2016 at 03:07, Igal @ Lucee.org wrote: I noticed that you usually don't put html in the emails here, but I think that it's appropriate here to

Re: [HACKERS] Proposal: RETURNING primary_key()

2016-03-12 Thread Michael Paquier
On Fri, Mar 11, 2016 at 5:28 AM, Craig Ringer wrote: > On 11 March 2016 at 03:07, Igal @ Lucee.org wrote: >> I noticed that you usually don't put html in the emails here, but I think >> that it's appropriate here to show the information in a clear way

Re: [HACKERS] Proposal: RETURNING primary_key()

2016-03-11 Thread Igal @ Lucee.org
On 3/11/2016 12:40 AM, Craig Ringer wrote: That's why (sorry, Igal) I'd like to see some more tests for cases other than identity columns. How is GENERATED ALWAYS handled, if supported? What about if it's on a UNIQUE column? How about a PRIMARY KEY whose value is assigned by a DEFAULT or by

Re: [HACKERS] Proposal: RETURNING primary_key()

2016-03-11 Thread Craig Ringer
On 11 March 2016 at 16:00, Vladimir Sitnikov wrote: > Igal, thanks for the analysis. > > Craig>Part of the question for Pg is what exactly we should and should > not be returning. > > I think the following might be a good starting point: return set of > columns that

Re: [HACKERS] Proposal: RETURNING primary_key()

2016-03-11 Thread Vladimir Sitnikov
Igal, thanks for the analysis. Craig>Part of the question for Pg is what exactly we should and should not be returning. I think the following might be a good starting point: return set of columns that would identify the inserted row(s). E.g. columns of any primary key would do. Columns of any

Re: [HACKERS] Proposal: RETURNING primary_key()

2016-03-10 Thread Joshua D. Drake
On 03/10/2016 08:28 PM, Craig Ringer wrote: On 11 March 2016 at 03:07, Igal @ Lucee.org > wrote: I noticed that you usually don't put html in the emails here, but I think that it's appropriate here to show the information in a clear way (also,

Re: [HACKERS] Proposal: RETURNING primary_key()

2016-03-10 Thread Craig Ringer
On 11 March 2016 at 03:07, Igal @ Lucee.org wrote: > > I noticed that you usually don't put html in the emails here, but I think > that it's appropriate here to show the information in a clear way (also, > according to my computer it's 2016). > Pretty sure we have at least one

Re: [HACKERS] Proposal: RETURNING primary_key()

2016-03-10 Thread Robert Haas
On Mar 10, 2016, at 2:07 PM, Igal @ Lucee.org wrote: > (Side note: This was my first, and hopefully my last, experience with Oracle > database, and it's been a real PITA. If I had tried it out some 20 years ago > then the experience would have probably led me to sell the

Re: [HACKERS] Proposal: RETURNING primary_key()

2016-03-10 Thread Igal @ Lucee.org
On 3/8/2016 4:42 PM, Craig Ringer wrote: On 9 March 2016 at 05:40, Igal @ Lucee.org > wrote: I will try to gather more information about the other DBMSs and drivers and will post my findings here when I have them. Thanks. I know that's not the

Re: [HACKERS] Proposal: RETURNING primary_key()

2016-03-09 Thread Craig Ringer
On 10 March 2016 at 00:41, Igal @ Lucee.org wrote: > On 3/8/2016 5:12 PM, Craig Ringer wrote: > >> One of the worst problems (IMO) is in the driver architecture its self. >> It attempts to prevent blocking by guestimating the server's send buffer >> state and its recv buffer

Re: [HACKERS] Proposal: RETURNING primary_key()

2016-03-09 Thread Igal @ Lucee.org
On 3/8/2016 5:12 PM, Craig Ringer wrote: One of the worst problems (IMO) is in the driver architecture its self. It attempts to prevent blocking by guestimating the server's send buffer state and its recv buffer state, trying to stop them filling and causing the server to block on writes. It

Re: [HACKERS] Proposal: RETURNING primary_key()

2016-03-09 Thread Craig Ringer
On 9 March 2016 at 21:30, Robert Haas wrote: > On Tue, Mar 8, 2016 at 8:12 PM, Craig Ringer > wrote: > > There certainly are server/protocol frustrations. > > I'm sympathetic to all of these and think we should work on fixing > them, particularly...

Re: [HACKERS] Proposal: RETURNING primary_key()

2016-03-09 Thread Robert Haas
On Tue, Mar 8, 2016 at 8:12 PM, Craig Ringer wrote: > There certainly are server/protocol frustrations. I'm sympathetic to all of these and think we should work on fixing them, particularly... > STRING TYPE ISSUES > --- > > PgJDBC can work around Pg's IMO somewhat

Re: [HACKERS] Proposal: RETURNING primary_key()

2016-03-08 Thread Craig Ringer
On 9 March 2016 at 04:12, Robert Haas wrote: > I think we have a general problem with the server lacking > certain capabilities that make it easy to implement a high-quality > JDBC driver. And I think it would be good to work on figuring out how > to fix that. There

Re: [HACKERS] Proposal: RETURNING primary_key()

2016-03-08 Thread Craig Ringer
On 9 March 2016 at 05:40, Igal @ Lucee.org wrote: > On 3/8/2016 12:12 PM, Robert Haas wrote: > >> I agree that some research should be done on how this works in other >> systems, but I think we have a general problem with the server lacking >> certain capabilities that make it

Re: [HACKERS] Proposal: RETURNING primary_key()

2016-03-08 Thread Igal @ Lucee.org
On 3/8/2016 12:12 PM, Robert Haas wrote: I agree that some research should be done on how this works in other systems, but I think we have a general problem with the server lacking certain capabilities that make it easy to implement a high-quality JDBC driver. And I think it would be good to

Re: [HACKERS] Proposal: RETURNING primary_key()

2016-03-08 Thread Robert Haas
On Mon, Mar 7, 2016 at 11:18 PM, Tom Lane wrote: > Craig Ringer writes: >> On 8 March 2016 at 08:56, Igal @ Lucee.org wrote: >>> I'm not sure why it was not accepted at the end? > >> The biggest issue, though it might not be clear from

Re: [HACKERS] Proposal: RETURNING primary_key()

2016-03-07 Thread Tom Lane
Craig Ringer writes: > On 8 March 2016 at 08:56, Igal @ Lucee.org wrote: >> I'm not sure why it was not accepted at the end? > The biggest issue, though it might not be clear from that thread, is that > what exactly it means to "return generated keys" is

Re: [HACKERS] Proposal: RETURNING primary_key()

2016-03-07 Thread Craig Ringer
On 8 March 2016 at 08:56, Igal @ Lucee.org wrote: > > I'm not sure why it was not accepted at the end? The biggest issue, though it might not be clear from that thread, is that what exactly it means to "return generated keys" is poorly defined by JDBC, and not necessarily the

Re: [HACKERS] Proposal: RETURNING primary_key()

2016-03-07 Thread Igal @ Lucee.org
Ian, On 3/7/2016 4:17 PM, Ian Barwick wrote: FYI something similar has been proposed before: http://www.postgresql.org/message-id/53953efb.8070...@2ndquadrant.com The linked thread might provide more insights into the issues surrounding this proposal. It's funny how I've encountered the

Re: [HACKERS] Proposal: RETURNING primary_key()

2016-03-07 Thread Ian Barwick
Hi On 08/03/16 05:32, Igal @ Lucee.org wrote: > THE ISSUE: > > In JDBC there is a flag called RETURN_GENERATED_KEYS -- > https://docs.oracle.com/javase/7/docs/api/java/sql/Statement.html#RETURN_GENERATED_KEYS > (...) > THE PROPOSAL: > > The proposal is to allow something like RETURNING

Re: [HACKERS] Proposal: RETURNING primary_key()

2016-03-07 Thread Igal @ Lucee.org
On 3/7/2016 1:20 PM, Tom Lane wrote: Yeah. I'm rather suspicious of this proposal; I do not think it's actually very useful to return a primary-key value without any indication of what the primary key is. There are also corner cases where it seems pretty ill-defined. For example, suppose you

Re: [HACKERS] Proposal: RETURNING primary_key()

2016-03-07 Thread Tom Lane
"Igal @ Lucee.org" writes: > On 3/7/2016 12:45 PM, Joshua D. Drake wrote: >> I agree that the problem is that you don't always know what the >> primary key is. >> I would argue the solution is to check before you write the query. Yeah. I'm rather suspicious of this proposal; I

Re: [HACKERS] Proposal: RETURNING primary_key()

2016-03-07 Thread Igal @ Lucee.org
On 3/7/2016 12:45 PM, Joshua D. Drake wrote: I agree that the problem is that you don't always know what the primary key is. I would argue the solution is to check before you write the query. Sure, that would be great, but perhaps I should have give some more context: We have an

Re: [HACKERS] Proposal: RETURNING primary_key()

2016-03-07 Thread Joshua D. Drake
On 03/07/2016 12:32 PM, Igal @ Lucee.org wrote: The problem is that we do not always know in advance what the Primary Key is, and therefore a solution that was implemented in the pgjdbc I agree that the problem is that you don't always know what the primary key is. I would argue the