From bc09d5e4cc1813c9af60c4537fe7d70ed1baae11 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Mon, 25 Feb 2019 08:38:59 +0100 Subject: [PATCH] Remove unnecessary use of PROCEDURAL Remove some unnecessary, legacy-looking use of the PROCEDURAL keyword before LANGUAGE. We mostly don't use this anymore, so some of these look a bit old. There is still some use in pg_dump, which is harder to remove because it's baked into the archive format, so I'm not touching that. Discussion: https://www.postgresql.org/message-id/2330919b-62d9-29ac-8de3-58c024fdcb96@2ndquadrant.com --- doc/src/sgml/xplang.sgml | 4 ++-- src/backend/commands/proclang.c | 7 +++---- src/include/nodes/parsenodes.h | 3 +-- src/pl/plperl/plperl--1.0.sql | 4 ++-- src/pl/plperl/plperl--unpackaged--1.0.sql | 2 +- src/pl/plperl/plperlu--1.0.sql | 4 ++-- src/pl/plperl/plperlu--unpackaged--1.0.sql | 2 +- src/pl/plpgsql/src/plpgsql--1.0.sql | 4 ++-- src/pl/plpgsql/src/plpgsql--unpackaged--1.0.sql | 2 +- src/pl/plpython/plpython2u--1.0.sql | 4 ++-- src/pl/plpython/plpython2u--unpackaged--1.0.sql | 2 +- src/pl/plpython/plpython3u--1.0.sql | 4 ++-- src/pl/plpython/plpython3u--unpackaged--1.0.sql | 2 +- src/pl/plpython/plpythonu--1.0.sql | 4 ++-- src/pl/plpython/plpythonu--unpackaged--1.0.sql | 2 +- src/pl/tcl/pltcl--1.0.sql | 4 ++-- src/pl/tcl/pltcl--unpackaged--1.0.sql | 2 +- src/pl/tcl/pltclu--1.0.sql | 4 ++-- src/pl/tcl/pltclu--unpackaged--1.0.sql | 2 +- 19 files changed, 30 insertions(+), 32 deletions(-) diff --git a/doc/src/sgml/xplang.sgml b/doc/src/sgml/xplang.sgml index db765b4644..d215ce82d0 100644 --- a/doc/src/sgml/xplang.sgml +++ b/doc/src/sgml/xplang.sgml @@ -137,7 +137,7 @@ CREATE FUNCTION validator_function_name(oid) Finally, the PL must be declared with the command -CREATE TRUSTED PROCEDURAL LANGUAGE language-name +CREATE TRUSTED LANGUAGE language-name HANDLER handler_function_name INLINE inline_function_name VALIDATOR validator_function_name ; @@ -200,7 +200,7 @@ CREATE FUNCTION plperl_validator(oid) RETURNS void AS The command: -CREATE TRUSTED PROCEDURAL LANGUAGE plperl +CREATE TRUSTED LANGUAGE plperl HANDLER plperl_call_handler INLINE plperl_inline_handler VALIDATOR plperl_validator; diff --git a/src/backend/commands/proclang.c b/src/backend/commands/proclang.c index 59c4e8dfd0..b7917618bf 100644 --- a/src/backend/commands/proclang.c +++ b/src/backend/commands/proclang.c @@ -1,7 +1,7 @@ /*------------------------------------------------------------------------- * * proclang.c - * PostgreSQL PROCEDURAL LANGUAGE support code. + * PostgreSQL LANGUAGE support code. * * Portions Copyright (c) 1996-2019, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California @@ -55,9 +55,8 @@ static ObjectAddress create_proc_lang(const char *languageName, bool replace, Oid valOid, bool trusted); static PLTemplate *find_language_template(const char *languageName); -/* --------------------------------------------------------------------- - * CREATE PROCEDURAL LANGUAGE - * --------------------------------------------------------------------- +/* + * CREATE LANGUAGE */ ObjectAddress CreateProceduralLanguage(CreatePLangStmt *stmt) diff --git a/src/include/nodes/parsenodes.h b/src/include/nodes/parsenodes.h index 6d035a072e..a7e859dc90 100644 --- a/src/include/nodes/parsenodes.h +++ b/src/include/nodes/parsenodes.h @@ -2433,8 +2433,7 @@ typedef struct AlterEventTrigStmt } AlterEventTrigStmt; /* ---------------------- - * Create/Drop PROCEDURAL LANGUAGE Statements - * Create PROCEDURAL LANGUAGE Statements + * Create LANGUAGE Statements * ---------------------- */ typedef struct CreatePLangStmt diff --git a/src/pl/plperl/plperl--1.0.sql b/src/pl/plperl/plperl--1.0.sql index 801900f023..f716ba1c56 100644 --- a/src/pl/plperl/plperl--1.0.sql +++ b/src/pl/plperl/plperl--1.0.sql @@ -6,6 +6,6 @@ * knowledge into this script. */ -CREATE PROCEDURAL LANGUAGE plperl; +CREATE LANGUAGE plperl; -COMMENT ON PROCEDURAL LANGUAGE plperl IS 'PL/Perl procedural language'; +COMMENT ON LANGUAGE plperl IS 'PL/Perl procedural language'; diff --git a/src/pl/plperl/plperl--unpackaged--1.0.sql b/src/pl/plperl/plperl--unpackaged--1.0.sql index b062bd5d9b..5e097c443d 100644 --- a/src/pl/plperl/plperl--unpackaged--1.0.sql +++ b/src/pl/plperl/plperl--unpackaged--1.0.sql @@ -1,6 +1,6 @@ /* src/pl/plperl/plperl--unpackaged--1.0.sql */ -ALTER EXTENSION plperl ADD PROCEDURAL LANGUAGE plperl; +ALTER EXTENSION plperl ADD LANGUAGE plperl; -- ALTER ADD LANGUAGE doesn't pick up the support functions, so we have to. ALTER EXTENSION plperl ADD FUNCTION plperl_call_handler(); ALTER EXTENSION plperl ADD FUNCTION plperl_inline_handler(internal); diff --git a/src/pl/plperl/plperlu--1.0.sql b/src/pl/plperl/plperlu--1.0.sql index d1d213dd5f..7efb4fbc5b 100644 --- a/src/pl/plperl/plperlu--1.0.sql +++ b/src/pl/plperl/plperlu--1.0.sql @@ -6,6 +6,6 @@ * knowledge into this script. */ -CREATE PROCEDURAL LANGUAGE plperlu; +CREATE LANGUAGE plperlu; -COMMENT ON PROCEDURAL LANGUAGE plperlu IS 'PL/PerlU untrusted procedural language'; +COMMENT ON LANGUAGE plperlu IS 'PL/PerlU untrusted procedural language'; diff --git a/src/pl/plperl/plperlu--unpackaged--1.0.sql b/src/pl/plperl/plperlu--unpackaged--1.0.sql index bc62d36a3d..36de1ddf49 100644 --- a/src/pl/plperl/plperlu--unpackaged--1.0.sql +++ b/src/pl/plperl/plperlu--unpackaged--1.0.sql @@ -1,6 +1,6 @@ /* src/pl/plperl/plperlu--unpackaged--1.0.sql */ -ALTER EXTENSION plperlu ADD PROCEDURAL LANGUAGE plperlu; +ALTER EXTENSION plperlu ADD LANGUAGE plperlu; -- ALTER ADD LANGUAGE doesn't pick up the support functions, so we have to. ALTER EXTENSION plperlu ADD FUNCTION plperlu_call_handler(); ALTER EXTENSION plperlu ADD FUNCTION plperlu_inline_handler(internal); diff --git a/src/pl/plpgsql/src/plpgsql--1.0.sql b/src/pl/plpgsql/src/plpgsql--1.0.sql index 5eeea56824..ab6fa84ab0 100644 --- a/src/pl/plpgsql/src/plpgsql--1.0.sql +++ b/src/pl/plpgsql/src/plpgsql--1.0.sql @@ -6,6 +6,6 @@ * knowledge into this script. */ -CREATE PROCEDURAL LANGUAGE plpgsql; +CREATE LANGUAGE plpgsql; -COMMENT ON PROCEDURAL LANGUAGE plpgsql IS 'PL/pgSQL procedural language'; +COMMENT ON LANGUAGE plpgsql IS 'PL/pgSQL procedural language'; diff --git a/src/pl/plpgsql/src/plpgsql--unpackaged--1.0.sql b/src/pl/plpgsql/src/plpgsql--unpackaged--1.0.sql index 9de7e8392a..15a74f091d 100644 --- a/src/pl/plpgsql/src/plpgsql--unpackaged--1.0.sql +++ b/src/pl/plpgsql/src/plpgsql--unpackaged--1.0.sql @@ -1,6 +1,6 @@ /* src/pl/plpgsql/src/plpgsql--unpackaged--1.0.sql */ -ALTER EXTENSION plpgsql ADD PROCEDURAL LANGUAGE plpgsql; +ALTER EXTENSION plpgsql ADD LANGUAGE plpgsql; -- ALTER ADD LANGUAGE doesn't pick up the support functions, so we have to. ALTER EXTENSION plpgsql ADD FUNCTION plpgsql_call_handler(); ALTER EXTENSION plpgsql ADD FUNCTION plpgsql_inline_handler(internal); diff --git a/src/pl/plpython/plpython2u--1.0.sql b/src/pl/plpython/plpython2u--1.0.sql index e3a12b952e..661cc66a89 100644 --- a/src/pl/plpython/plpython2u--1.0.sql +++ b/src/pl/plpython/plpython2u--1.0.sql @@ -6,6 +6,6 @@ * knowledge into this script. */ -CREATE PROCEDURAL LANGUAGE plpython2u; +CREATE LANGUAGE plpython2u; -COMMENT ON PROCEDURAL LANGUAGE plpython2u IS 'PL/Python2U untrusted procedural language'; +COMMENT ON LANGUAGE plpython2u IS 'PL/Python2U untrusted procedural language'; diff --git a/src/pl/plpython/plpython2u--unpackaged--1.0.sql b/src/pl/plpython/plpython2u--unpackaged--1.0.sql index a89d8b4d09..6efa2dbad9 100644 --- a/src/pl/plpython/plpython2u--unpackaged--1.0.sql +++ b/src/pl/plpython/plpython2u--unpackaged--1.0.sql @@ -1,6 +1,6 @@ /* src/pl/plpython/plpython2u--unpackaged--1.0.sql */ -ALTER EXTENSION plpython2u ADD PROCEDURAL LANGUAGE plpython2u; +ALTER EXTENSION plpython2u ADD LANGUAGE plpython2u; -- ALTER ADD LANGUAGE doesn't pick up the support functions, so we have to. ALTER EXTENSION plpython2u ADD FUNCTION plpython2_call_handler(); ALTER EXTENSION plpython2u ADD FUNCTION plpython2_inline_handler(internal); diff --git a/src/pl/plpython/plpython3u--1.0.sql b/src/pl/plpython/plpython3u--1.0.sql index cd1fb636a0..c0d6ea82c2 100644 --- a/src/pl/plpython/plpython3u--1.0.sql +++ b/src/pl/plpython/plpython3u--1.0.sql @@ -6,6 +6,6 @@ * knowledge into this script. */ -CREATE PROCEDURAL LANGUAGE plpython3u; +CREATE LANGUAGE plpython3u; -COMMENT ON PROCEDURAL LANGUAGE plpython3u IS 'PL/Python3U untrusted procedural language'; +COMMENT ON LANGUAGE plpython3u IS 'PL/Python3U untrusted procedural language'; diff --git a/src/pl/plpython/plpython3u--unpackaged--1.0.sql b/src/pl/plpython/plpython3u--unpackaged--1.0.sql index b1c0d03a30..fb8d3d6a65 100644 --- a/src/pl/plpython/plpython3u--unpackaged--1.0.sql +++ b/src/pl/plpython/plpython3u--unpackaged--1.0.sql @@ -1,6 +1,6 @@ /* src/pl/plpython/plpython3u--unpackaged--1.0.sql */ -ALTER EXTENSION plpython3u ADD PROCEDURAL LANGUAGE plpython3u; +ALTER EXTENSION plpython3u ADD LANGUAGE plpython3u; -- ALTER ADD LANGUAGE doesn't pick up the support functions, so we have to. ALTER EXTENSION plpython3u ADD FUNCTION plpython3_call_handler(); ALTER EXTENSION plpython3u ADD FUNCTION plpython3_inline_handler(internal); diff --git a/src/pl/plpython/plpythonu--1.0.sql b/src/pl/plpython/plpythonu--1.0.sql index 61d3d554c9..4a3e64aac5 100644 --- a/src/pl/plpython/plpythonu--1.0.sql +++ b/src/pl/plpython/plpythonu--1.0.sql @@ -6,6 +6,6 @@ * knowledge into this script. */ -CREATE PROCEDURAL LANGUAGE plpythonu; +CREATE LANGUAGE plpythonu; -COMMENT ON PROCEDURAL LANGUAGE plpythonu IS 'PL/PythonU untrusted procedural language'; +COMMENT ON LANGUAGE plpythonu IS 'PL/PythonU untrusted procedural language'; diff --git a/src/pl/plpython/plpythonu--unpackaged--1.0.sql b/src/pl/plpython/plpythonu--unpackaged--1.0.sql index 7926233250..16b828f2fe 100644 --- a/src/pl/plpython/plpythonu--unpackaged--1.0.sql +++ b/src/pl/plpython/plpythonu--unpackaged--1.0.sql @@ -1,6 +1,6 @@ /* src/pl/plpython/plpythonu--unpackaged--1.0.sql */ -ALTER EXTENSION plpythonu ADD PROCEDURAL LANGUAGE plpythonu; +ALTER EXTENSION plpythonu ADD LANGUAGE plpythonu; -- ALTER ADD LANGUAGE doesn't pick up the support functions, so we have to. ALTER EXTENSION plpythonu ADD FUNCTION plpython_call_handler(); ALTER EXTENSION plpythonu ADD FUNCTION plpython_inline_handler(internal); diff --git a/src/pl/tcl/pltcl--1.0.sql b/src/pl/tcl/pltcl--1.0.sql index ecb264c818..34a68c8471 100644 --- a/src/pl/tcl/pltcl--1.0.sql +++ b/src/pl/tcl/pltcl--1.0.sql @@ -6,6 +6,6 @@ * knowledge into this script. */ -CREATE PROCEDURAL LANGUAGE pltcl; +CREATE LANGUAGE pltcl; -COMMENT ON PROCEDURAL LANGUAGE pltcl IS 'PL/Tcl procedural language'; +COMMENT ON LANGUAGE pltcl IS 'PL/Tcl procedural language'; diff --git a/src/pl/tcl/pltcl--unpackaged--1.0.sql b/src/pl/tcl/pltcl--unpackaged--1.0.sql index dfad66c268..294125892a 100644 --- a/src/pl/tcl/pltcl--unpackaged--1.0.sql +++ b/src/pl/tcl/pltcl--unpackaged--1.0.sql @@ -1,5 +1,5 @@ /* src/pl/tcl/pltcl--unpackaged--1.0.sql */ -ALTER EXTENSION pltcl ADD PROCEDURAL LANGUAGE pltcl; +ALTER EXTENSION pltcl ADD LANGUAGE pltcl; -- ALTER ADD LANGUAGE doesn't pick up the support functions, so we have to. ALTER EXTENSION pltcl ADD FUNCTION pltcl_call_handler(); diff --git a/src/pl/tcl/pltclu--1.0.sql b/src/pl/tcl/pltclu--1.0.sql index 72dcef11e5..e05b470aaf 100644 --- a/src/pl/tcl/pltclu--1.0.sql +++ b/src/pl/tcl/pltclu--1.0.sql @@ -6,6 +6,6 @@ * knowledge into this script. */ -CREATE PROCEDURAL LANGUAGE pltclu; +CREATE LANGUAGE pltclu; -COMMENT ON PROCEDURAL LANGUAGE pltclu IS 'PL/TclU untrusted procedural language'; +COMMENT ON LANGUAGE pltclu IS 'PL/TclU untrusted procedural language'; diff --git a/src/pl/tcl/pltclu--unpackaged--1.0.sql b/src/pl/tcl/pltclu--unpackaged--1.0.sql index a5d359fc04..dac18f8d87 100644 --- a/src/pl/tcl/pltclu--unpackaged--1.0.sql +++ b/src/pl/tcl/pltclu--unpackaged--1.0.sql @@ -1,5 +1,5 @@ /* src/pl/tcl/pltclu--unpackaged--1.0.sql */ -ALTER EXTENSION pltclu ADD PROCEDURAL LANGUAGE pltclu; +ALTER EXTENSION pltclu ADD LANGUAGE pltclu; -- ALTER ADD LANGUAGE doesn't pick up the support functions, so we have to. ALTER EXTENSION pltclu ADD FUNCTION pltclu_call_handler(); -- 2.40.0