1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-08 11:42:09 +03:00

Add DISCARD SEQUENCES command.

DISCARD ALL will now discard cached sequence information, as well.

Fabrízio de Royes Mello, reviewed by Zoltán Böszörményi, with some
further tweaks by me.
This commit is contained in:
Robert Haas
2013-10-03 16:17:18 -04:00
parent c64e68fd9f
commit d90ced8bb2
10 changed files with 53 additions and 4 deletions

View File

@ -18,13 +18,14 @@
#include "commands/async.h"
#include "commands/discard.h"
#include "commands/prepare.h"
#include "commands/sequence.h"
#include "utils/guc.h"
#include "utils/portal.h"
static void DiscardAll(bool isTopLevel);
/*
* DISCARD { ALL | TEMP | PLANS }
* DISCARD { ALL | SEQUENCES | TEMP | PLANS }
*/
void
DiscardCommand(DiscardStmt *stmt, bool isTopLevel)
@ -39,6 +40,10 @@ DiscardCommand(DiscardStmt *stmt, bool isTopLevel)
ResetPlanCache();
break;
case DISCARD_SEQUENCES:
ResetSequenceCaches();
break;
case DISCARD_TEMP:
ResetTempTableNamespace();
break;
@ -69,4 +74,5 @@ DiscardAll(bool isTopLevel)
LockReleaseAll(USER_LOCKMETHOD, true);
ResetPlanCache();
ResetTempTableNamespace();
ResetSequenceCaches();
}