1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-30 11:03:19 +03:00

Remove the "opaque" pseudo-type and associated compatibility hacks.

A long time ago, it was necessary to declare datatype I/O functions,
triggers, and language handler support functions in a very type-unsafe
way involving a single pseudo-type "opaque".  We got rid of those
conventions in 7.3, but there was still support in various places to
automatically convert such functions to the modern declaration style,
to be able to transparently re-load dumps from pre-7.3 servers.
It seems unnecessary to continue to support that anymore, so take out
the hacks; whereupon the "opaque" pseudo-type itself is no longer
needed and can be dropped.

This is part of a group of patches removing various server-side kluges
for transparently upgrading pre-8.0 dump files.  Since we've had few
complaints about dropping pg_dump's support for dumping from pre-8.0
servers (commit 64f3524e2), it seems okay to now remove these kluges.

Discussion: https://postgr.es/m/4110.1583255415@sss.pgh.pa.us
This commit is contained in:
Tom Lane
2020-03-05 15:48:56 -05:00
parent 84eca14bc4
commit bb03010b9f
22 changed files with 173 additions and 437 deletions

View File

@ -4827,10 +4827,6 @@ SELECT * FROM pg_attribute
<primary>unknown</primary>
</indexterm>
<indexterm zone="datatype-pseudo">
<primary>opaque</primary>
</indexterm>
<para>
The <productname>PostgreSQL</productname> type system contains a
number of special-purpose entries that are collectively called
@ -4953,12 +4949,6 @@ SELECT * FROM pg_attribute
<entry>Identifies a not-yet-resolved type, e.g. of an undecorated
string literal.</entry>
</row>
<row>
<entry><type>opaque</type></entry>
<entry>An obsolete type name that formerly served many of the above
purposes.</entry>
</row>
</tbody>
</tgroup>
</table>

View File

@ -211,16 +211,6 @@ CREATE [ OR REPLACE ] [ TRUSTED ] [ PROCEDURAL ] LANGUAGE <replaceable class="pa
database, which will cause it to be available automatically in
all subsequently-created databases.
</para>
<para>
In <productname>PostgreSQL</productname> versions before 7.3, it was
necessary to declare handler functions as returning the placeholder
type <type>opaque</type>, rather than <type>language_handler</type>.
To support loading
of old dump files, <command>CREATE LANGUAGE</command> will accept a function
declared as returning <type>opaque</type>, but it will issue a notice and
change the function's declared return type to <type>language_handler</type>.
</para>
</refsect1>
<refsect1 id="sql-createlanguage-examples">

View File

@ -543,15 +543,6 @@ UPDATE OF <replaceable>column_name1</replaceable> [, <replaceable>column_name2</
row-level triggers with transition relations cannot be defined on
partitions or inheritance child tables.
</para>
<para>
In <productname>PostgreSQL</productname> versions before 7.3, it was
necessary to declare trigger functions as returning the placeholder
type <type>opaque</type>, rather than <type>trigger</type>. To support loading
of old dump files, <command>CREATE TRIGGER</command> will accept a function
declared as returning <type>opaque</type>, but it will issue a notice and
change the function's declared return type to <type>trigger</type>.
</para>
</refsect1>
<refsect1 id="sql-createtrigger-examples">

View File

@ -823,18 +823,6 @@ CREATE TYPE <replaceable class="parameter">name</replaceable>
function is written in C.
</para>
<para>
In <productname>PostgreSQL</productname> versions before 7.3, it
was customary to avoid creating a shell type at all, by replacing the
functions' forward references to the type name with the placeholder
pseudo-type <type>opaque</type>. The <type>cstring</type> arguments and
results also had to be declared as <type>opaque</type> before 7.3. To
support loading of old dump files, <command>CREATE TYPE</command> will
accept I/O functions declared using <type>opaque</type>, but it will issue
a notice and change the function declarations to use the correct
types.
</para>
</refsect1>
<refsect1>