pgsql: Remove support for upgrading extensions from "unpackaged" state.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Remove support for upgrading extensions from "unpackaged" state.
Date: 2020-02-19 21:59:29
Message-ID: E1j4XNR-0005Ay-Dp@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Remove support for upgrading extensions from "unpackaged" state.

Andres Freund pointed out that allowing non-superusers to run
"CREATE EXTENSION ... FROM unpackaged" has security risks, since
the unpackaged-to-1.0 scripts don't try to verify that the existing
objects they're modifying are what they expect. Just attaching such
objects to an extension doesn't seem too dangerous, but some of them
do more than that.

We could have resolved this, perhaps, by still requiring superuser
privilege to use the FROM option. However, it's fair to ask just what
we're accomplishing by continuing to lug the unpackaged-to-1.0 scripts
forward. None of them have received any real testing since 9.1 days,
so they may not even work anymore (even assuming that one could still
load the previous "loose" object definitions into a v13 database).
And an installation that's trying to go from pre-9.1 to v13 or later
in one jump is going to have worse compatibility problems than whether
there's a trivial way to convert their contrib modules into extension
style.

Hence, let's just drop both those scripts and the core-code support
for "CREATE EXTENSION ... FROM".

Discussion: https://postgr.es/m/20200213233015.r6rnubcvl4egdh5r@alap3.anarazel.de

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/70a7732007bc4689f4c7a44e738eb2d892dac1e3

Modified Files
--------------
contrib/btree_gin/Makefile | 2 +-
contrib/btree_gin/btree_gin--unpackaged--1.0.sql | 119 -----
contrib/btree_gist/Makefile | 2 +-
contrib/btree_gist/btree_gist--unpackaged--1.0.sql | 479 ---------------------
contrib/citext/Makefile | 2 +-
contrib/citext/citext--unpackaged--1.0.sql | 200 ---------
contrib/cube/Makefile | 3 +-
contrib/cube/cube--unpackaged--1.0.sql | 56 ---
contrib/dblink/Makefile | 3 +-
contrib/dblink/dblink--unpackaged--1.0.sql | 46 --
contrib/dict_int/Makefile | 2 +-
contrib/dict_int/dict_int--unpackaged--1.0.sql | 9 -
contrib/dict_xsyn/Makefile | 2 +-
contrib/dict_xsyn/dict_xsyn--unpackaged--1.0.sql | 9 -
contrib/earthdistance/Makefile | 3 +-
.../earthdistance--unpackaged--1.0.sql | 16 -
contrib/fuzzystrmatch/Makefile | 3 +-
.../fuzzystrmatch--unpackaged--1.0.sql | 23 -
contrib/hstore/Makefile | 3 +-
contrib/hstore/hstore--unpackaged--1.0.sql | 92 ----
contrib/intagg/Makefile | 2 +-
contrib/intagg/intagg--unpackaged--1.0.sql | 9 -
contrib/intarray/Makefile | 3 +-
contrib/intarray/intarray--unpackaged--1.0.sql | 111 -----
contrib/isn/Makefile | 2 +-
contrib/isn/isn--unpackaged--1.0.sql | 464 --------------------
contrib/lo/Makefile | 2 +-
contrib/lo/lo--unpackaged--1.0.sql | 8 -
contrib/ltree/Makefile | 2 +-
contrib/ltree/ltree--unpackaged--1.0.sql | 134 ------
contrib/pageinspect/Makefile | 2 +-
.../pageinspect/pageinspect--unpackaged--1.0.sql | 31 --
contrib/pg_buffercache/Makefile | 3 +-
.../pg_buffercache--unpackaged--1.0.sql | 7 -
contrib/pg_freespacemap/Makefile | 2 +-
.../pg_freespacemap--unpackaged--1.0.sql | 7 -
contrib/pg_stat_statements/Makefile | 3 +-
.../pg_stat_statements--unpackaged--1.0.sql | 8 -
contrib/pg_trgm/Makefile | 2 +-
contrib/pg_trgm/pg_trgm--1.3.sql | 4 +-
contrib/pg_trgm/pg_trgm--unpackaged--1.0.sql | 98 -----
contrib/pgcrypto/Makefile | 2 +-
contrib/pgcrypto/pgcrypto--unpackaged--1.0.sql | 38 --
contrib/pgrowlocks/Makefile | 3 +-
contrib/pgrowlocks/pgrowlocks--unpackaged--1.0.sql | 6 -
contrib/pgstattuple/Makefile | 3 +-
.../pgstattuple/pgstattuple--unpackaged--1.0.sql | 9 -
contrib/seg/Makefile | 2 +-
contrib/seg/seg--unpackaged--1.0.sql | 54 ---
contrib/spi/Makefile | 8 +-
contrib/spi/autoinc--unpackaged--1.0.sql | 6 -
contrib/spi/insert_username--unpackaged--1.0.sql | 6 -
contrib/spi/moddatetime--unpackaged--1.0.sql | 6 -
contrib/spi/refint--unpackaged--1.0.sql | 7 -
contrib/sslinfo/Makefile | 3 +-
contrib/sslinfo/sslinfo--unpackaged--1.0.sql | 22 -
contrib/tablefunc/Makefile | 2 +-
contrib/tablefunc/tablefunc--unpackaged--1.0.sql | 19 -
contrib/unaccent/Makefile | 2 +-
contrib/unaccent/unaccent--unpackaged--1.0.sql | 16 -
contrib/uuid-ossp/Makefile | 2 +-
contrib/uuid-ossp/uuid-ossp--unpackaged--1.0.sql | 15 -
contrib/xml2/Makefile | 2 +-
contrib/xml2/xml2--unpackaged--1.0.sql | 29 --
contrib/xml2/xml2.control | 2 +-
doc/src/sgml/contrib.sgml | 16 -
doc/src/sgml/extend.sgml | 27 --
doc/src/sgml/ref/create_extension.sgml | 43 +-
src/backend/commands/extension.c | 70 +--
src/backend/parser/gram.y | 7 +-
src/pl/plperl/GNUmakefile | 4 +-
src/pl/plperl/plperl--unpackaged--1.0.sql | 7 -
src/pl/plperl/plperlu--unpackaged--1.0.sql | 7 -
src/pl/plpgsql/src/Makefile | 2 +-
src/pl/plpgsql/src/plpgsql--unpackaged--1.0.sql | 7 -
src/pl/plpython/Makefile | 4 +-
src/pl/plpython/plpython2u--unpackaged--1.0.sql | 7 -
src/pl/plpython/plpython3u--unpackaged--1.0.sql | 7 -
src/pl/plpython/plpythonu--unpackaged--1.0.sql | 7 -
src/pl/tcl/Makefile | 4 +-
src/pl/tcl/pltcl--unpackaged--1.0.sql | 5 -
src/pl/tcl/pltclu--unpackaged--1.0.sql | 5 -
src/test/modules/test_parser/Makefile | 2 +-
.../test_parser/test_parser--unpackaged--1.0.sql | 10 -
84 files changed, 55 insertions(+), 2428 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2020-02-19 23:52:37 pgsql: Doc: discourage use of partial indexes for poor-man's-partitioni
Previous Message Tom Lane 2020-02-19 21:01:54 Re: pgsql: Clean up some code, comments and docs referring to Windows 2000