Re: [BUGS] BUG #6360: with hold cursor, cause function executed twice and wrong results

2012-01-09 Thread Robert Haas
On Tue, Dec 27, 2011 at 12:47 PM, Tom Lane t...@sss.pgh.pa.us wrote: wcting...@163.com writes: The reason is that the function p_test_execute is executed twice, when *fetch*, it is first executed, and when transaction commit, because the cursor is a *holdable* cursor, it is executed again.

Re: [BUGS] BUG #6360: with hold cursor, cause function executed twice and wrong results

2011-12-27 Thread Tom Lane
wcting...@163.com writes: The reason is that the function p_test_execute is executed twice, when *fetch*, it is first executed, and when transaction commit, because the cursor is a *holdable* cursor, it is executed again. Yup. I don't particularly see this as a bug. If you were to manually

Re: [BUGS] BUG #6360: with hold cursor, cause function executed twice and wrong results

2011-12-27 Thread wcting163
At 2011-12-28 01:47:20,Tom Lane t...@sss.pgh.pa.us wrote: Yup. I don't particularly see this as a bug. If you were to manually rewind and rescan the cursor (ie, MOVE BACKWARD ALL and re-fetch), the function would be executed multiple times too. If you don't want that to happen, the best way