Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
82fde1aa
Commit
82fde1aa
authored
Aug 08, 2004
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add note pointing out the difference in semantics between Oracle and
plpgsql EXCEPTION blocks.
parent
35a5fb68
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
3 deletions
+36
-3
doc/src/sgml/plpgsql.sgml
doc/src/sgml/plpgsql.sgml
+36
-3
No files found.
doc/src/sgml/plpgsql.sgml
View file @
82fde1aa
<!--
$PostgreSQL: pgsql/doc/src/sgml/plpgsql.sgml,v 1.4
4 2004/08/08 00:50:58
tgl Exp $
$PostgreSQL: pgsql/doc/src/sgml/plpgsql.sgml,v 1.4
5 2004/08/08 22:40:46
tgl Exp $
-->
<chapter id="plpgsql">
...
...
@@ -2647,7 +2647,7 @@ show errors;
<para>
The <literal>show errors</literal> command does not exist in
<productname>PostgreSQL</>, and is not needed since errors are
reported automatically.
reported automatically.
</para>
</listitem>
</itemizedlist>
...
...
@@ -3009,7 +3009,8 @@ $$ LANGUAGE plpgsql;
<para>
The exception names supported by <application>PL/pgSQL</> are
different from Oracle's. The set of built-in exception names
is much larger (see <xref linkend="errcodes-appendix">).
is much larger (see <xref linkend="errcodes-appendix">). There
is not currently a way to declare user-defined exception names.
</para>
</callout>
</calloutlist>
...
...
@@ -3032,6 +3033,38 @@ $$ LANGUAGE plpgsql;
<productname>PostgreSQL</productname>.
</para>
<sect3 id="plpgsql-porting-exceptions">
<title>Implicit Rollback after Exceptions</title>
<para>
In <application>PL/pgSQL</>, when an exception is caught by an
<literal>EXCEPTION</> clause, all database changes since the block's
<literal>BEGIN</> are automatically rolled back. That is, the behavior
is equivalent to what you'd get in Oracle with
<programlisting>
BEGIN
SAVEPOINT s1;
... code here ...
EXCEPTION
WHEN ... THEN
ROLLBACK TO s1;
... code here ...
WHEN ... THEN
ROLLBACK TO s1;
... code here ...
END;
</programlisting>
If you are translating an Oracle procedure that uses
<command>SAVEPOINT</> and <command>ROLLBACK TO</> in this style,
your task is easy: just omit the <command>SAVEPOINT</> and
<command>ROLLBACK TO</>. If you have a procedure that uses
<command>SAVEPOINT</> and <command>ROLLBACK TO</> in a different way
then some actual thought will be required.
</para>
</sect3>
<sect3>
<title><command>EXECUTE</command></title>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment