Eine aufbereitete Darstellung der Quelle

 
     
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

Quelle  discard.c

  Sprache: C
 

/*-------------------------------------------------------------------------
 *
 * discard.c
 *   The implementation of the DISCARD command
 *
 * Copyright (c) 1996-2025, PostgreSQL Global Development Group
 *
 *
 * IDENTIFICATION
 *   src/backend/commands/discard.c
 *
 *-------------------------------------------------------------------------
 */

#include "postgres.h"

#include "access/xact.h"
#include "catalog/namespace.h"
#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 | SEQUENCES | TEMP | PLANS }
 */

void
DiscardCommand(DiscardStmt *stmt, bool isTopLevel)
{
 switch (stmt->target)
 {
  case DISCARD_ALL:
   DiscardAll(isTopLevel);
   break;

  case DISCARD_PLANS:
   ResetPlanCache();
   break;

  case DISCARD_SEQUENCES:
   ResetSequenceCaches();
   break;

  case DISCARD_TEMP:
   ResetTempTableNamespace();
   break;

  default:
   elog(ERROR, "unrecognized DISCARD target: %d", stmt->target);
 }
}

static void
DiscardAll(bool isTopLevel)
{
 /*
  * Disallow DISCARD ALL in a transaction block. This is arguably
  * inconsistent (we don't make a similar check in the command sequence
  * that DISCARD ALL is equivalent to), but the idea is to catch mistakes:
  * DISCARD ALL inside a transaction block would leave the transaction
  * still uncommitted.
 */

 PreventInTransactionBlock(isTopLevel, "DISCARD ALL");

 /* Closing portals might run user-defined code, so do that first. */
 PortalHashTableDeleteAll();
 SetPGVariable("session_authorization", NIL, false);
 ResetAllOptions();
 DropAllPreparedStatements();
 Async_UnlistenAll();
 LockReleaseAll(USER_LOCKMETHOD, true);
 ResetPlanCache();
 ResetTempTableNamespace();
 ResetSequenceCaches();
}

Messung V0.5 in Prozent
C=93 H=95 G=93

¤ Dauer der Verarbeitung: 0.11 Sekunden  (vorverarbeitet am  2026-08-08) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Open Source Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik

Statistik
#Sources=141584
#Domains=738142