]> granicus.if.org Git - postgresql/commitdiff
Back-patch change to make DISCARD ALL release advisory locks.
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 27 Nov 2008 00:34:49 +0000 (00:34 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 27 Nov 2008 00:34:49 +0000 (00:34 +0000)
Per discussion.

doc/src/sgml/ref/discard.sgml
src/backend/commands/discard.c

index a4ca919394c41b925848d03071d437a8f54b991c..9572d5ab858a27d0dcd5da4ce875ceb6135c8ed5 100644 (file)
@@ -1,5 +1,5 @@
 <!--
-$PostgreSQL: pgsql/doc/src/sgml/ref/discard.sgml,v 1.2 2007/04/26 18:00:24 neilc Exp $
+$PostgreSQL: pgsql/doc/src/sgml/ref/discard.sgml,v 1.2.2.1 2008/11/27 00:34:49 tgl Exp $
 PostgreSQL documentation
 -->
 
@@ -70,15 +70,16 @@ DISCARD { ALL | PLANS | TEMPORARY | TEMP }
     <listitem>
      <para>
       Releases all temporary resources associated with the current
-      session and resets the session to its initial state. This has
-      the same effect as executing the following sequence of
-      statements:
+      session and resets the session to its initial state.
+      Currently, this has the same effect as executing the following sequence
+      of statements:
 <programlisting>
 SET SESSION AUTHORIZATION DEFAULT;
 RESET ALL;
 DEALLOCATE ALL;
 CLOSE ALL;
 UNLISTEN *;
+SELECT pg_advisory_unlock_all();
 DISCARD PLANS;
 DISCARD TEMP;
 </programlisting>
index 65d910c3209ed751a2242ca5ee53606c41b5256a..adf663f6ee919073d73694ea9d0d0a4a902b85e0 100644 (file)
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *       $PostgreSQL: pgsql/src/backend/commands/discard.c,v 1.4 2008/01/01 19:45:49 momjian Exp $
+ *       $PostgreSQL: pgsql/src/backend/commands/discard.c,v 1.4.2.1 2008/11/27 00:34:49 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -19,6 +19,7 @@
 #include "commands/discard.h"
 #include "commands/prepare.h"
 #include "commands/variable.h"
+#include "storage/lock.h"
 #include "utils/plancache.h"
 #include "utils/portal.h"
 
@@ -66,6 +67,7 @@ DiscardAll(bool isTopLevel)
        DropAllPreparedStatements();
        PortalHashTableDeleteAll();
        Async_UnlistenAll();
+       LockReleaseAll(USER_LOCKMETHOD, true);
        ResetPlanCache();
        ResetTempTableNamespace();
 }