Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Postgres/src/test/isolation/specs/   (Postgres Database Version 18.4©)  Datei vom 11.4.2026 mit Größe 788 B image not shown  

Quelle  multixact-no-deadlock.spec  Sprache: unbekannt

 
Spracherkennung für: .spec vermutete Sprache: Unknown {[0] [0] [0]} [Methode: Schwerpunktbildung, einfache Gewichte, sechs Dimensionen]

# If we already hold a lock of a given strength, do not deadlock when
# some other transaction is waiting for a conflicting lock and we try
# to acquire the same lock we already held.
setup
{
  CREATE TABLE justthis (
 value int
  );

  INSERT INTO justthis VALUES (1);
}

teardown
{
  DROP TABLE justthis;
}

session s1
setup   { BEGIN; }
step s1lock  { SELECT * FROM justthis FOR SHARE; }
step s1svpt  { SAVEPOINT foo; }
step s1lock2 { SELECT * FROM justthis FOR SHARE; }
step s1c  { COMMIT; }

session s2
setup   { BEGIN; }
step s2lock  { SELECT * FROM justthis FOR SHARE; } # ensure it's a multi
step s2c  { COMMIT; }

session s3
setup   { BEGIN; }
step s3lock  { SELECT * FROM justthis FOR UPDATE; }
step s3c  { COMMIT; }

permutation s1lock s2lock s1svpt s3lock s1lock2 s2c s1c s3c

[Dauer der Verarbeitung: 0.13 Sekunden, vorverarbeitet 2026-09-27]