diff options
author | Tom Lane | 2020-03-05 20:48:56 +0000 |
---|---|---|
committer | Tom Lane | 2020-03-05 20:48:56 +0000 |
commit | bb03010b9f0766e10399174fe850b2506907c4e4 (patch) | |
tree | b74a4c09b4b9c93c890f6f504f12446b09d6ed89 /src/pl | |
parent | 84eca14bc4bdf71911cceb3a6286bc47db3a5a06 (diff) |
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/[email protected]
Diffstat (limited to 'src/pl')
-rw-r--r-- | src/pl/plperl/plperl.c | 4 | ||||
-rw-r--r-- | src/pl/plpgsql/src/pl_handler.c | 6 | ||||
-rw-r--r-- | src/pl/plpython/plpy_main.c | 4 |
3 files changed, 4 insertions, 10 deletions
diff --git a/src/pl/plperl/plperl.c b/src/pl/plperl/plperl.c index a65bce07135..5fdf303fe6b 100644 --- a/src/pl/plperl/plperl.c +++ b/src/pl/plperl/plperl.c @@ -2000,9 +2000,7 @@ plperl_validator(PG_FUNCTION_ARGS) /* except for TRIGGER, EVTTRIGGER, RECORD, or VOID */ if (functyptype == TYPTYPE_PSEUDO) { - /* we assume OPAQUE with no arguments means a trigger */ - if (proc->prorettype == TRIGGEROID || - (proc->prorettype == OPAQUEOID && proc->pronargs == 0)) + if (proc->prorettype == TRIGGEROID) is_trigger = true; else if (proc->prorettype == EVTTRIGGEROID) is_event_trigger = true; diff --git a/src/pl/plpgsql/src/pl_handler.c b/src/pl/plpgsql/src/pl_handler.c index b83087e8d2f..b434818e541 100644 --- a/src/pl/plpgsql/src/pl_handler.c +++ b/src/pl/plpgsql/src/pl_handler.c @@ -421,12 +421,10 @@ plpgsql_validator(PG_FUNCTION_ARGS) functyptype = get_typtype(proc->prorettype); /* Disallow pseudotype result */ - /* except for TRIGGER, RECORD, VOID, or polymorphic */ + /* except for TRIGGER, EVTTRIGGER, RECORD, VOID, or polymorphic */ if (functyptype == TYPTYPE_PSEUDO) { - /* we assume OPAQUE with no arguments means a trigger */ - if (proc->prorettype == TRIGGEROID || - (proc->prorettype == OPAQUEOID && proc->pronargs == 0)) + if (proc->prorettype == TRIGGEROID) is_dml_trigger = true; else if (proc->prorettype == EVTTRIGGEROID) is_event_trigger = true; diff --git a/src/pl/plpython/plpy_main.c b/src/pl/plpython/plpy_main.c index 882d69e14a1..3eedaa80da7 100644 --- a/src/pl/plpython/plpy_main.c +++ b/src/pl/plpython/plpy_main.c @@ -379,9 +379,7 @@ plpython2_inline_handler(PG_FUNCTION_ARGS) static bool PLy_procedure_is_trigger(Form_pg_proc procStruct) { - return (procStruct->prorettype == TRIGGEROID || - (procStruct->prorettype == OPAQUEOID && - procStruct->pronargs == 0)); + return (procStruct->prorettype == TRIGGEROID); } static void |