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:
@ -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();
|
||||
}
|
||||
|
Reference in New Issue
Block a user