Re: [HACKERS] Snapshot warning

2008-11-25 Thread Alvaro Herrera
Pavan Deolasee escribió: > Following test case gives a warning of snapshot not destroyed at commit > time. > > CREATE TABLE test (a int); > INSERT INTO test VALUES (1); > BEGIN; > DECLARE c CURSOR FOR SELECT * FROM test FOR update; > SAVEPOINT A; > FETCH -2 FROM c; > ROLLBACK TO SAVEPOINT A; > COM

Re: [HACKERS] Snapshot warning

2008-11-25 Thread Tom Lane
Alvaro Herrera <[EMAIL PROTECTED]> writes: > Tom Lane escribió: >> Hmm, that's a bit problematic because resowner.c doesn't have any global >> notion of what resource owners exist. I think you still need to have >> snapmgr.c maintain a list of all known snapshots. resowner.c can only >> help you

Re: [HACKERS] Snapshot warning

2008-11-25 Thread Alvaro Herrera
Tom Lane escribió: > Alvaro Herrera <[EMAIL PROTECTED]> writes: > > After the patch we don't have any way to detect whether resowner.c has > > any snapshot still linked to. I assume there's no objection to adding a > > new entry point in resowner.c for this. > > Hmm, that's a bit problematic beca

Re: [HACKERS] Snapshot warning

2008-11-25 Thread Tom Lane
Alvaro Herrera <[EMAIL PROTECTED]> writes: > After the patch we don't have any way to detect whether resowner.c has > any snapshot still linked to. I assume there's no objection to adding a > new entry point in resowner.c for this. Hmm, that's a bit problematic because resowner.c doesn't have any

Re: [HACKERS] Snapshot warning

2008-11-25 Thread Alvaro Herrera
Alvaro Herrera escribió: > The only thing I'm now missing is SnapshotResetXmin(). It currently > looks like this: > After the patch we don't have any way to detect whether resowner.c has > any snapshot still linked to. I assume there's no objection to adding a > new entry point in resowner.c f

Re: [HACKERS] Snapshot warning

2008-11-25 Thread Alvaro Herrera
Tom Lane escribió: > Alvaro Herrera <[EMAIL PROTECTED]> writes: > > Tom Lane escribió: > >> I think the fundamental bug here is that you tried to skip using the > >> ResourceOwner mechanism for snapshot references. That's basically > >> not gonna work. > > > Right :-( I'll see how to go about th

Re: [HACKERS] Snapshot warning

2008-11-24 Thread Tom Lane
Alvaro Herrera <[EMAIL PROTECTED]> writes: > Pavan Deolasee escribió: >> Should we call FreeQueryDesc() even for failed portals in PortalCleanup() ? >> Or PortalDrop() is a better(right) place to do that ? > That doesn't work; doing it causes a crash: I think the fundamental bug here is that you

Re: [HACKERS] Snapshot warning

2008-11-24 Thread Tom Lane
Alvaro Herrera <[EMAIL PROTECTED]> writes: > Tom Lane escribió: >> I think the fundamental bug here is that you tried to skip using the >> ResourceOwner mechanism for snapshot references. That's basically >> not gonna work. > Right :-( I'll see how to go about this. It strikes me that you migh

Re: [HACKERS] Snapshot warning

2008-11-24 Thread Alvaro Herrera
Tom Lane escribió: > Alvaro Herrera <[EMAIL PROTECTED]> writes: > > Pavan Deolasee escribi�: > >> Should we call FreeQueryDesc() even for failed portals in PortalCleanup() ? > >> Or PortalDrop() is a better(right) place to do that ? > > > That doesn't work; doing it causes a crash: > > I think th

Re: [HACKERS] Snapshot warning

2008-11-24 Thread Alvaro Herrera
Pavan Deolasee escribió: > Following test case gives a warning of snapshot not destroyed at commit > time. > > CREATE TABLE test (a int); > INSERT INTO test VALUES (1); > BEGIN; > DECLARE c CURSOR FOR SELECT * FROM test FOR update; > SAVEPOINT A; > FETCH -2 FROM c; > ROLLBACK TO SAVEPOINT A; > COM

[HACKERS] Snapshot warning

2008-11-23 Thread Pavan Deolasee
Following test case gives a warning of snapshot not destroyed at commit time. CREATE TABLE test (a int); INSERT INTO test VALUES (1); BEGIN; DECLARE c CURSOR FOR SELECT * FROM test FOR update; SAVEPOINT A; FETCH -2 FROM c; ROLLBACK TO SAVEPOINT A; COMMIT; Should we call FreeQueryDesc() even for f