Re: [HACKERS] updateable cursors visibility

2003-04-02 Thread Gavin Sherry
On Mon, 31 Mar 2003, Peter Eisentraut wrote: Tom Lane writes: Serializable or not, there is a good case for saying that cursors don't see changes made after they are opened, period. No one disputes that insensitive cursors are a valid concept. But this discussion is about updating

Re: [HACKERS] updateable cursors visibility

2003-04-02 Thread Tom Lane
Gavin Sherry [EMAIL PROTECTED] writes: Regardless of which, we could insert a special case in ExecutePlan() (or somewhere more appropriate?) to test that the tuple returned from the lower level ExecTidScan() still satisifies the cursor query. It should be sufficient to use HeapTupleSatisfies()

Re: [HACKERS] updateable cursors visibility

2003-03-31 Thread Hiroshi Inoue
-Original Message- From: Hannu Krosing [mailto:[EMAIL PROTECTED] Hiroshi Inoue kirjutas E, 31.03.2003 kell 03:40: 2) dynamic It can detect any changes made to the membership, order, and values of the result set after the cursor is opened. What would it mean in

Re: [HACKERS] updateable cursors visibility

2003-03-31 Thread Hannu Krosing
Hiroshi Inoue kirjutas E, 31.03.2003 kell 03:40: Tom Lane wrote: Serializable or not, there is a good case for saying that cursors don't see changes made after they are opened, period. The current implementation locks down the cursor's snapshot at DECLARE time. It's only because

Re: [HACKERS] updateable cursors visibility

2003-03-31 Thread Hannu Krosing
Hiroshi Inoue kirjutas E, 31.03.2003 kell 19:08: -Original Message- From: Hannu Krosing [mailto:[EMAIL PROTECTED] Hiroshi Inoue kirjutas E, 31.03.2003 kell 03:40: 2) dynamic It can detect any changes made to the membership, order, and values of the result set

Re: [HACKERS] updateable cursors visibility

2003-03-30 Thread Hiroshi Inoue
Tom Lane wrote: Peter Eisentraut [EMAIL PROTECTED] writes: Hiroshi Inoue writes: Must a SENSITIVE cursor see other applications' changes made while the cursor is open ? Yes. It is immaterial whether the change came from a different application or the same one.

Re: [HACKERS] updateable cursors visibility

2003-03-30 Thread Tom Lane
Peter Eisentraut [EMAIL PROTECTED] writes: Hiroshi Inoue writes: Must a SENSITIVE cursor see other applications' changes made while the cursor is open ? Yes. It is immaterial whether the change came from a different application or the same one. Nevertheless, the cursor sensitivity does not

Re: [HACKERS] updateable cursors visibility

2003-03-29 Thread Peter Eisentraut
Hiroshi Inoue writes: Must a SENSITIVE cursor see other applications' changes made while the cursor is open ? Yes. It is immaterial whether the change came from a different application or the same one. Nevertheless, the cursor sensitivity does not excuse you from observing the transaction

Re: [HACKERS] updateable cursors visibility

2003-03-28 Thread Bruce Momjian
Hiroshi Inoue wrote: -Original Message- From: Bruce Momjian [mailto:[EMAIL PROTECTED] Hiroshi Inoue wrote: If the cursor is INSENSITIVE, it mustn't see the row ? Right. If so, isn't the difference between SENSITIVE and INSENSITIVE extreme ? Yes. Why

Re: [HACKERS] updateable cursors visibility

2003-03-28 Thread Hiroshi Inoue
-Original Message- From: Bruce Momjian [mailto:[EMAIL PROTECTED] Hiroshi Inoue wrote: I don't understand what you two are discussing. What's is SENSITIVE, INSENSITIVE or ASESNSITIVE ? In SQL99 standard, I see: - If the cursor is insensitive, then

Re: [HACKERS] updateable cursors visibility

2003-03-28 Thread Bruce Momjian
Hiroshi Inoue wrote: If the cursor is INSENSITIVE, it mustn't see the row ? Right. If so, isn't the difference between SENSITIVE and INSENSITIVE extreme ? Yes. Why do you or Peter refer to ASENSITIVE little ? Not sure --- ASENSITIVE seems to be do whatever you want, which is always

Re: [HACKERS] updateable cursors visibility

2003-03-28 Thread Hiroshi Inoue
-Original Message- From: Bruce Momjian [mailto:[EMAIL PROTECTED] Hiroshi Inoue wrote: If the cursor is INSENSITIVE, it mustn't see the row ? Right. If so, isn't the difference between SENSITIVE and INSENSITIVE extreme ? Yes. Why do you or Peter refer to

Re: [HACKERS] updateable cursors visibility

2003-03-28 Thread Bruce Momjian
Hiroshi Inoue wrote: I don't understand what you two are discussing. What's is SENSITIVE, INSENSITIVE or ASESNSITIVE ? In SQL99 standard, I see: - If the cursor is insensitive, then significant changes are not visible. - If the cursor is

Re: [HACKERS] updateable cursors visibility

2003-03-27 Thread Hiroshi Inoue
Bruce Momjian wrote: Peter Eisentraut wrote: Bruce Momjian writes: One idea is to require FOR UPDATE on the cursor --- while that prevents other transactions from changing the cursor, it doesn't deal with the current transaction modifying the table outside the

Re: [HACKERS] updateable cursors visibility

2003-03-27 Thread Bruce Momjian
Hiroshi Inoue wrote: Bruce Momjian wrote: Peter Eisentraut wrote: Bruce Momjian writes: One idea is to require FOR UPDATE on the cursor --- while that prevents other transactions from changing the cursor, it doesn't deal with the current transaction modifying the table

Re: [HACKERS] updateable cursors visibility

2003-03-27 Thread Han
Hiroshi Inoue, But still can't explain this: SENSITIVE = not READ_ONLY It's in the ODBC Spec. Bruce Momjian wrote: Sorry, no idea. Peter's idea is that FOR UPDATE requires SENSITIVE, so INSENSITIVE has to be READONLY because the update has to see

Re: [HACKERS] updateable cursors visibility

2003-03-27 Thread Hiroshi Inoue
Bruce Momjian wrote: Hiroshi Inoue wrote: Bruce Momjian wrote: Peter Eisentraut wrote: Bruce Momjian writes: I don't understand what you two are discussing. What's is SENSITIVE, INSENSITIVE or ASESNSITIVE ? In SQL99 standard, I see:

Re: [HACKERS] updateable cursors visibility

2003-03-27 Thread Hiroshi Inoue
Bruce Momjian wrote: Sorry, no idea. Peter's idea is that FOR UPDATE requires SENSITIVE, so INSENSITIVE has to be READONLY because the update has to see other changes to be accurate. I think clearly SENSITIVE/READONLY should be possible, so:

Re: [HACKERS] updateable cursors visibility

2003-03-26 Thread Bruce Momjian
Sorry, no idea. Peter's idea is that FOR UPDATE requires SENSITIVE, so INSENSITIVE has to be READONLY because the update has to see other changes to be accurate. I think clearly SENSITIVE/READONLY should be possible, so: READONLY/SENSITIVE possible READONLY/INSENSITIVE

Re: [HACKERS] updateable cursors visibility

2003-03-25 Thread snpe
Hello Neil, I try example for Oracle jdbc 1.4 driver This is sample and results. I hope that is helps. If you want yet another example, please tell me. regards Haris Peco /** * A simple sample to check the availability of scrollable result sets. * * Please use jdk1.2 or later version

[HACKERS] updateable cursors visibility

2003-03-24 Thread Neil Conway
Folks, I'd like to implement updateable cursors. I'll be working on just getting updateable cursors working for relatively simple SELECT queries (e.g. no joins, aggregates, grouping, user-defined function calls, etc.). BTW, I believe that's all the SQL spec requires, but I need to double check

Re: [HACKERS] updateable cursors visibility

2003-03-24 Thread Tom Lane
Neil Conway [EMAIL PROTECTED] writes: - if the user updates a row X in the cursor, then rewinds the cursor and fetches X again, should they see the new X or the old X? If it's considered an insensitive cursor, I'd think it should see the old X. You would have a hard time making the code do

Re: [HACKERS] updateable cursors visibility

2003-03-24 Thread Bruce Momjian
Neil Conway wrote: On Mon, 2003-03-24 at 22:50, Hiroshi Inoue wrote: Does the SQL standard allow INSENSITIVE updatable cursors ? Hmmm... apparently not: (Subsection 14.1, Syntax Rules of DECLARE CURSOR) 11) If an updatability clause of FOR UPDATE with or without a column name list is

Re: [HACKERS] updateable cursors visibility

2003-03-24 Thread Hiroshi Inoue
Neil Conway wrote: Folks, I'd like to implement updateable cursors. I'll be working on just getting updateable cursors working for relatively simple SELECT queries (e.g. no joins, aggregates, grouping, user-defined function calls, etc.). BTW, I believe that's all the

Re: [HACKERS] updateable cursors visibility

2003-03-24 Thread Neil Conway
On Mon, 2003-03-24 at 22:50, Hiroshi Inoue wrote: Does the SQL standard allow INSENSITIVE updatable cursors ? Hmmm... apparently not: (Subsection 14.1, Syntax Rules of DECLARE CURSOR) 11) If an updatability clause of FOR UPDATE with or without a column name list is specified, then INSENSITIVE