1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-27 12:41:57 +03:00

Provide an upgrade strategy for dump files containing functions declared

with OPAQUE.  CREATE LANGUAGE, CREATE TRIGGER, and CREATE TYPE will all
accept references to functions declared with OPAQUE --- but they will
issue a NOTICE, and will modify the function entries in pg_proc to have
the preferred type-safe argument or result types instead of OPAQUE.
Per recent pghackers discussions.
This commit is contained in:
Tom Lane
2002-09-21 18:39:26 +00:00
parent bc49968764
commit eb3adab568
12 changed files with 239 additions and 93 deletions

View File

@ -1,5 +1,5 @@
<!--
$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_language.sgml,v 1.27 2002/08/22 00:01:40 tgl Exp $
$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_language.sgml,v 1.28 2002/09/21 18:39:25 tgl Exp $
PostgreSQL documentation
-->
@ -200,6 +200,16 @@ ERROR: PL handler function <replaceable class="parameter">funcname</replaceable
will call <command>CREATE LANGUAGE</command> internally.)
</para>
<para>
In <productname>PostgreSQL</productname> versions before 7.3, it was
necessary to declare handler functions as returning the placeholder
type <type>opaque</>, rather than <type>language_handler</>.
To support loading
of old dump files, <command>CREATE LANGUAGE</> will accept a function
declared as returning <type>opaque</>, but it will issue a NOTICE and
change the function's declared return type to <type>language_handler</>.
</para>
<para>
Use the <xref linkend="sql-createfunction" endterm="sql-createfunction-title"> command to create a new
function.

View File

@ -1,5 +1,5 @@
<!--
$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_trigger.sgml,v 1.27 2002/08/22 00:01:40 tgl Exp $
$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_trigger.sgml,v 1.28 2002/09/21 18:39:25 tgl Exp $
PostgreSQL documentation
-->
@ -170,9 +170,10 @@ CREATE TRIGGER
<para>
In <productname>PostgreSQL</productname> versions before 7.3, it was
necessary to declare trigger functions as returning the placeholder
type <type>opaque</>, rather than <type>trigger</>. This is still
supported, but is deprecated because it is obscure and causes loss of
type safety.
type <type>opaque</>, rather than <type>trigger</>. To support loading
of old dump files, <command>CREATE TRIGGER</> will accept a function
declared as returning <type>opaque</>, but it will issue a NOTICE and
change the function's declared return type to <type>trigger</>.
</para>
<para>

View File

@ -1,5 +1,5 @@
<!--
$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_type.sgml,v 1.35 2002/09/21 18:32:54 petere Exp $
$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_type.sgml,v 1.36 2002/09/21 18:39:25 tgl Exp $
PostgreSQL documentation
-->
@ -262,8 +262,10 @@ CREATE TYPE
forward references to the type name with the placeholder pseudo-type
<type>OPAQUE</>. The <type>cstring</> inputs and
results also had to be declared as <type>OPAQUE</> before 7.3.
Use of <type>OPAQUE</> for this purpose is still supported, but it is
deprecated because it causes loss of type safety.
To support loading
of old dump files, <command>CREATE TYPE</> will accept functions
declared using <type>opaque</>, but it will issue a NOTICE and
change the function's declaration to use the correct types.
</para>
</note>