File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change 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 function definition must be a
202+ The complete text of a function body must be a
185203 <firstterm>block</>. A block is defined as:
186204
187205<synopsis>
You can’t perform that action at this time.
0 commit comments