@@ -143,6 +143,21 @@ SELECT clean_emp();
143143</screen>
144144 </para>
145145
146+ <note>
147+ <para>
148+ The entire body of a SQL function is parsed before any of it is
149+ executed. While a SQL function can contain commands that alter
150+ the system catalogs (e.g., <command>CREATE TABLE</>), the effects
151+ of such commands will not be visible during parse analysis of
152+ later commands in the function. Thus, for example,
153+ <literal>CREATE TABLE foo (...); INSERT INTO foo VALUES(...);</literal>
154+ will not work as desired if packaged up into a single SQL function,
155+ since <structname>foo</> won't exist yet when the <command>INSERT</>
156+ command is parsed. It's recommended to use <application>PL/PgSQL</>
157+ instead of a SQL function in this type of situation.
158+ </para>
159+ </note>
160+
146161 <para>
147162 The syntax of the <command>CREATE FUNCTION</command> command requires
148163 the function body to be written as a string constant. It is usually