Add compatibility note warning that plpgsql is now stricter about the column

datatypes of composite results, per gripe from Marcel Asio.  Some desultory
copy-editing of plpgsql-related sections of the release notes.
This commit is contained in:
Tom Lane 2010-06-29 21:20:19 +00:00
parent b57ddccf05
commit 5dbf489868
1 changed files with 107 additions and 78 deletions

View File

@ -1,4 +1,4 @@
<!-- $PostgreSQL: pgsql/doc/src/sgml/release-9.0.sgml,v 2.35 2010/06/24 18:33:05 rhaas Exp $ -->
<!-- $PostgreSQL: pgsql/doc/src/sgml/release-9.0.sgml,v 2.36 2010/06/29 21:20:19 tgl Exp $ -->
<sect1 id="release-9-0">
<title>Release 9.0</title>
@ -30,10 +30,11 @@
<listitem>
<para>
Built-in, binary, log-based replication. This advance consists of two features:
Hot Standby allows continuous archive standby database servers to accept read-only
queries, and Streaming Replication allows continuous archive (<acronym>WAL</>) files
to be streamed over a network port to a standby database server.
Built-in, binary, log-based replication. This advance consists of two
features: Hot Standby allows continuous archive standby database servers
to accept read-only queries, and Streaming Replication allows continuous
archive (<acronym>WAL</>) files to be streamed over a network port to a
standby database server.
</para>
</listitem>
@ -54,8 +55,9 @@
Broadly enhanced stored procedure support.
The <link linkend="SQL-DO"><command>DO</></link> statement permits
ad-hoc or anonymous code blocks. Functions can now be called using named
parameters. PL/pgSQL is now installed by default, and PL/Perl and PL/Python
have been enhanced in several ways, including support for Python3.
parameters. PL/pgSQL is now installed by default, and PL/Perl and
PL/Python have been enhanced in several ways, including support for
Python3.
</para>
</listitem>
@ -140,10 +142,11 @@
</para>
<para>
Version 9.0 contains a number of changes which selectively break backwards compatibility
in order to support new features and code quality improvements. Particularly, users
who make extensive use of PL/pgSQL and/or PITR and Warm Standby should test their
solutions for breakage. Observe the following incompatibilities:
Version 9.0 contains a number of changes which selectively break backwards
compatibility in order to support new features and code quality
improvements. Particularly, users who make extensive use of PL/pgSQL
and/or PITR and Warm Standby should test their solutions for breakage.
Observe the following incompatibilities:
</para>
<sect3>
@ -270,15 +273,15 @@
<listitem>
<para>
No longer change function input variable names via
<command>REPLACE FUNCTION</command>(Pavel Stehule).
<command>CREATE OR REPLACE FUNCTION</command> can no longer change
the declared names of function parameters (Pavel Stehule)
</para>
<para>
In order to support names parameter calls, it is
no longer possible to change the aliases for input variables
in the function declaration in place. You now have to <command>DROP
</command> and recreate the function.
In order to support named-parameter calls, it is
no longer allowed to change the aliases for input variables
in the declaration of an existing function. You now have to
<command>DROP</command> and recreate the function.
</para>
</listitem>
@ -287,22 +290,52 @@
</sect3>
<sect3>
<title>PL/pgSQL Variables</title>
<title>PL/pgSQL</title>
<itemizedlist>
<listitem>
<para>
Have PL/pgSQL throw an error if a variable name conflicts with a
PL/pgSQL now throws an error if a variable name conflicts with a
column name used in a query (Tom Lane)
</para>
<para>
This behavior can be changed via the server variable <link
The former behavior was to bind to variable names in preference to
query column names, which often resulted in surprising misbehavior.
Throwing an error allows easy detection of ambiguous situations.
Although it's recommended that functions encountering this type of
error be modified to remove the conflict, the old behavior can be
restored if necessary via the configuration parameter <link
linkend="plpgsql-var-subst"><varname>plpgsql.variable_conflict</></link>,
or by the per-function option <literal>#variable_conflict</>.
The former behavior was to bind to variable names over
column names, but not consistently. Stored procedures
with naming conflicts will probably need to be refactored.
or via the per-function option <literal>#variable_conflict</>.
</para>
</listitem>
<listitem>
<para>
PL/pgSQL no longer allows variable names that match SQL
reserved words (Tom Lane)
</para>
<para>
This is a consequence of aligning the PL/pgSQL parser to match the
core SQL parser more closely. If necessary,
variable names can be double-quoted to avoid this restriction.
</para>
</listitem>
<listitem>
<para>
PL/pgSQL now requires columns of composite results to match the
expected type modifier as well as base type (Pavel Stehule, Tom Lane)
</para>
<para>
For example, if a column of the result type is declared as
<literal>NUMERIC(30,2)</>, it is no longer acceptable to return a
<literal>NUMERIC</> of some other precision in that column. Previous
versions neglected to check the type modifier and would thus allow
result rows that didn't actually conform to the declared restrictions.
</para>
</listitem>
@ -312,21 +345,10 @@
</para>
<para>
Instead, use <link
linkend="plpgsql-declaration-parameters"><literal>ALIAS</></link>,
Instead of <literal>RENAME</>, use <link
linkend="plpgsql-declaration-alias"><literal>ALIAS</></link>,
which can now alias any variable, not just dollar sign
variables, e.g. <literal>$1</>.
</para>
</listitem>
<listitem>
<para>
PL/pgSQL no longer allows unquoted variables names that match SQL
reserved words (Tom Lane)
</para>
<para>
Variables can be double-quoted to avoid this restriction.
parameter names (such as <literal>$1</>).
</para>
</listitem>
</itemizedlist>
@ -339,12 +361,12 @@
<listitem>
<para>
Remove support for platforms that don't have a working 64-bit
integer data types (Tom Lane)
integer data type (Tom Lane)
</para>
<para>
It is believed all supported platforms have working 64-bit integer
data types.
It is believed all still-supported platforms have working 64-bit
integer data types.
</para>
</listitem>
</itemizedlist>
@ -423,8 +445,9 @@
<title>Performance</title>
<para>
Version 9.0 also contains several performance and optimizer enhancements to
improve specific uses of PostgreSQL and remedy certain poor-performing cases.
Version 9.0 also contains several performance and optimizer enhancements
to improve specific uses of PostgreSQL and remedy certain poor-performing
cases.
</para>
<itemizedlist>
@ -863,7 +886,7 @@
</para>
<para>
For drivers which support this feature, this saves an entire
For drivers that support this feature, this saves an entire
round-trip to the client, allowing result counts and pagination
to be calculated without a second <command>COUNT</command> query.
</para>
@ -1688,21 +1711,30 @@
<listitem>
<para>
Install server-side language PL/pgSQL by default (Bruce Momjian)
Install PL/pgSQL by default (Bruce Momjian)
</para>
</listitem>
<listitem>
<para>
Allow PL/pgSQL to handle row types with dropped columns (Pavel Stehule)
Improve PL/pgSQL's ability to handle row types with dropped columns
(Pavel Stehule)
</para>
</listitem>
<listitem>
<para>
Allow <literal>IN</> parameters to be assigned values within
Allow input parameters to be assigned values within
PL/pgSQL functions (Steve Prentice)
</para>
<para>
Formerly, input parameters were treated as being declared
<literal>CONST</>. This restriction has been removed to simplify
porting of functions from other DBMSes that do not impose the
equivalent restriction. An input parameter now acts like a local
variable initialized to the passed-in value.
</para>
</listitem>
<listitem>
@ -1713,21 +1745,19 @@
<listitem>
<para>
Have PL/pgSQL use the main lexer, rather than a custom version (Tom Lane)
Make PL/pgSQL use the main lexer, rather than its own version
(Tom Lane)
</para>
<para>
This ensures accurate tracking of the main system's behavior for details
such as string escaping.
</para>
</listitem>
</itemizedlist>
</sect4>
<sect4>
<title><link linkend="plpgsql-cursors">PL/pgSQL Cursors</link></title>
<itemizedlist>
<listitem>
<para>
Add count and <literal>ALL</> options to <command>MOVE
Add <replaceable>count</> and <literal>ALL</> options to <command>MOVE
FORWARD</>/<literal>BACKWARD</> in PL/pgSQL (Pavel Stehule)
</para>
</listitem>
@ -1741,8 +1771,8 @@
<listitem>
<para>
Add PL/pgSQL's <command>OPEN cursor FOR EXECUTE</> to use parameters
(Pavel Stehule, Itagaki Takahiro)
Allow PL/pgSQL's <command>OPEN <replaceable>cursor</> FOR EXECUTE</> to
use parameters (Pavel Stehule, Itagaki Takahiro)
</para>
<para>
@ -2482,7 +2512,7 @@
<listitem>
<para>
Enable the server lexer to be reentrant (Tom Lane)
Enable the server's lexer to be reentrant (Tom Lane)
</para>
<para>
@ -2796,9 +2826,8 @@
</para>
<para>
This filter dictionary removes accents from tokens, and
makes full-text searches over multiple languages much
easier.
This filter dictionary removes accents from letters, which
makes full-text searches over multiple languages much easier.
</para>
</listitem>