Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5334633

Browse files
committed
Doc: explain dollar quoting in the intro part of the pl/pgsql chapter.
We're throwing people into the guts of the syntax with not much context;let's back up one step and point out that this goes inside a literal ina CREATE FUNCTION command. Per suggestion from Kurt Kartaltepe.Discussion:https://postgr.es/m/CACawnnyWAmH+au8nfZhLiFfWKjXy4d0kY+eZWfcxPRnjVfaa_Q@mail.gmail.com
1 parentcde11fa commit5334633

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

‎doc/src/sgml/plpgsql.sgml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,9 +179,27 @@
179179
<sect1 id="plpgsql-structure">
180180
<title>Structure of <application>PL/pgSQL</application></title>
181181

182+
<para>
183+
Functions written in <application>PL/pgSQL</application> are defined
184+
to the server by executing <xref linkend="sql-createfunction"> commands.
185+
Such a command would normally look like, say,
186+
<programlisting>
187+
CREATE FUNCTION somefunc(integer, text) RETURNS integer
188+
AS '<replaceable>function body text</>'
189+
LANGUAGE plpgsql;
190+
</programlisting>
191+
The function body is simply a string literal so far as <command>CREATE
192+
FUNCTION</> is concerned. It is often helpful to use dollar quoting
193+
(see <xref linkend="sql-syntax-dollar-quoting">) to write the function
194+
body, rather than the normal single quote syntax. Without dollar quoting,
195+
any single quotes or backslashes in the function body must be escaped by
196+
doubling them. Almost all the examples in this chapter use dollar-quoted
197+
literals for their function bodies.
198+
</para>
199+
182200
<para>
183201
<application>PL/pgSQL</application> is a block-structured language.
184-
The complete text of a functiondefinition must be a
202+
The complete text of a functionbody must be a
185203
<firstterm>block</>. A block is defined as:
186204

187205
<synopsis>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp