blob: 9ff80d59e17e7d0c3a07059e9e611150ab441377 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
|
'\" t
.\" Title: RELEASE SAVEPOINT
.\" Author: The PostgreSQL Global Development Group
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
.\" Date: 2021
.\" Manual: PostgreSQL 13.4 Documentation
.\" Source: PostgreSQL 13.4
.\" Language: English
.\"
.TH "RELEASE SAVEPOINT" "7" "2021" "PostgreSQL 13.4" "PostgreSQL 13.4 Documentation"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
RELEASE_SAVEPOINT \- destroy a previously defined savepoint
.SH "SYNOPSIS"
.sp
.nf
RELEASE [ SAVEPOINT ] \fIsavepoint_name\fR
.fi
.SH "DESCRIPTION"
.PP
\fBRELEASE SAVEPOINT\fR
destroys a savepoint previously defined in the current transaction\&.
.PP
Destroying a savepoint makes it unavailable as a rollback point, but it has no other user visible behavior\&. It does not undo the effects of commands executed after the savepoint was established\&. (To do that, see
ROLLBACK TO SAVEPOINT (\fBROLLBACK_TO_SAVEPOINT\fR(7))\&.) Destroying a savepoint when it is no longer needed allows the system to reclaim some resources earlier than transaction end\&.
.PP
\fBRELEASE SAVEPOINT\fR
also destroys all savepoints that were established after the named savepoint was established\&.
.SH "PARAMETERS"
.PP
\fIsavepoint_name\fR
.RS 4
The name of the savepoint to destroy\&.
.RE
.SH "NOTES"
.PP
Specifying a savepoint name that was not previously defined is an error\&.
.PP
It is not possible to release a savepoint when the transaction is in an aborted state\&.
.PP
If multiple savepoints have the same name, only the one that was most recently defined is released\&.
.SH "EXAMPLES"
.PP
To establish and later destroy a savepoint:
.sp
.if n \{\
.RS 4
.\}
.nf
BEGIN;
INSERT INTO table1 VALUES (3);
SAVEPOINT my_savepoint;
INSERT INTO table1 VALUES (4);
RELEASE SAVEPOINT my_savepoint;
COMMIT;
.fi
.if n \{\
.RE
.\}
.sp
The above transaction will insert both 3 and 4\&.
.SH "COMPATIBILITY"
.PP
This command conforms to the
SQL
standard\&. The standard specifies that the key word
SAVEPOINT
is mandatory, but
PostgreSQL
allows it to be omitted\&.
.SH "SEE ALSO"
\fBBEGIN\fR(7), \fBCOMMIT\fR(7), \fBROLLBACK\fR(7), ROLLBACK TO SAVEPOINT (\fBROLLBACK_TO_SAVEPOINT\fR(7)), \fBSAVEPOINT\fR(7)
|