Skip to content

Commit 46c93bd

Browse files
committed
Further cleanup of RAISE discussion; in particular, remove example
that doesn't actually work.
1 parent 24baa1d commit 46c93bd

File tree

1 file changed

+18
-9
lines changed

1 file changed

+18
-9
lines changed

doc/src/sgml/plsql.sgml

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$Header: /cvsroot/pgsql/doc/src/sgml/Attic/plsql.sgml,v 2.28 2001/05/08 02:26:09 momjian Exp $
2+
$Header: /cvsroot/pgsql/doc/src/sgml/Attic/plsql.sgml,v 2.29 2001/05/08 02:53:24 tgl Exp $
33
-->
44

55
<chapter id="plpgsql">
@@ -1309,28 +1309,37 @@ END LOOP;
13091309
RAISE <replaceable class="parameter">level</replaceable> '<replaceable class="parameter">format</replaceable>' <optional>, <replaceable class="parameter">variable</replaceable> <optional>...</optional></optional>;
13101310
</synopsis>
13111311

1312-
Inside the format, <literal>%</literal> is replaced by the next argument's
1313-
external representation. Double <literal>%</literal>'s are output as <literal>%</literal>.
1314-
Possible levels are DEBUG (silently suppressed in production
1315-
running databases), NOTICE (written into the database log and forwarded to
1316-
the client application) and EXCEPTION (written into the database log and
1312+
Possible levels are DEBUG (write the message into the postmaster log),
1313+
NOTICE (write the message into the postmaster log and forward it to
1314+
the client application) and EXCEPTION (raise an error,
13171315
aborting the transaction).
1316+
Inside the format string, <literal>%</literal> is replaced by the next
1317+
optional argument's external representation.
1318+
Write <literal>%%</literal> to emit a literal <literal>%</literal>.
1319+
Note that the optional arguments must presently
1320+
be simple variables, not expressions, and the format must be a simple
1321+
string literal.
13181322
</para>
13191323

1324+
<!--
1325+
This example should work, but does not:
1326+
RAISE NOTICE ''Id number '' || key || '' not found!'';
1327+
Put it back when we allow non-string-literal formats.
1328+
-->
1329+
13201330
<para>
13211331
<programlisting>
1322-
RAISE NOTICE ''Id number '' || key || '' not found!'';
13231332
RAISE NOTICE ''Calling cs_create_job(%)'',v_job_id;
13241333
</programlisting>
1325-
In this last example, v_job_id will replace the % in the
1334+
In this example, the value of v_job_id will replace the % in the
13261335
string.
13271336
</para>
13281337

13291338
<para>
13301339
<programlisting>
13311340
RAISE EXCEPTION ''Inexistent ID --> %'',user_id;
13321341
</programlisting>
1333-
This will abort the transaction and write to the database log.
1342+
This will abort the transaction with the given error message.
13341343
</para>
13351344
</sect2>
13361345

0 commit comments

Comments
 (0)