Commit eb67623c authored by Tom Lane's avatar Tom Lane

Mark some contrib modules as "trusted".

This allows these modules to be installed into a database without
superuser privileges (assuming that the DBA or sysadmin has installed
the module's files in the expected place).  You only need CREATE
privilege on the current database, which by default would be
available to the database owner.

The following modules are marked trusted:

btree_gin
btree_gist
citext
cube
dict_int
earthdistance
fuzzystrmatch
hstore
hstore_plperl
intarray
isn
jsonb_plperl
lo
ltree
pg_trgm
pgcrypto
seg
tablefunc
tcn
tsm_system_rows
tsm_system_time
unaccent
uuid-ossp

In the future we might mark some more modules trusted, but there
seems to be no debate about these, and on the whole it seems wise
to be conservative with use of this feature to start out with.

Discussion: https://postgr.es/m/32315.1580326876@sss.pgh.pa.us
parent 7fdd919a
...@@ -3,3 +3,4 @@ comment = 'support for indexing common datatypes in GIN' ...@@ -3,3 +3,4 @@ comment = 'support for indexing common datatypes in GIN'
default_version = '1.3' default_version = '1.3'
module_pathname = '$libdir/btree_gin' module_pathname = '$libdir/btree_gin'
relocatable = true relocatable = true
trusted = true
...@@ -3,3 +3,4 @@ comment = 'support for indexing common datatypes in GiST' ...@@ -3,3 +3,4 @@ comment = 'support for indexing common datatypes in GiST'
default_version = '1.5' default_version = '1.5'
module_pathname = '$libdir/btree_gist' module_pathname = '$libdir/btree_gist'
relocatable = true relocatable = true
trusted = true
...@@ -3,3 +3,4 @@ comment = 'data type for case-insensitive character strings' ...@@ -3,3 +3,4 @@ comment = 'data type for case-insensitive character strings'
default_version = '1.6' default_version = '1.6'
module_pathname = '$libdir/citext' module_pathname = '$libdir/citext'
relocatable = true relocatable = true
trusted = true
...@@ -3,3 +3,4 @@ comment = 'data type for multidimensional cubes' ...@@ -3,3 +3,4 @@ comment = 'data type for multidimensional cubes'
default_version = '1.4' default_version = '1.4'
module_pathname = '$libdir/cube' module_pathname = '$libdir/cube'
relocatable = true relocatable = true
trusted = true
...@@ -3,3 +3,4 @@ comment = 'text search dictionary template for integers' ...@@ -3,3 +3,4 @@ comment = 'text search dictionary template for integers'
default_version = '1.0' default_version = '1.0'
module_pathname = '$libdir/dict_int' module_pathname = '$libdir/dict_int'
relocatable = true relocatable = true
trusted = true
...@@ -3,4 +3,5 @@ comment = 'calculate great-circle distances on the surface of the Earth' ...@@ -3,4 +3,5 @@ comment = 'calculate great-circle distances on the surface of the Earth'
default_version = '1.1' default_version = '1.1'
module_pathname = '$libdir/earthdistance' module_pathname = '$libdir/earthdistance'
relocatable = true relocatable = true
trusted = true
requires = 'cube' requires = 'cube'
...@@ -3,3 +3,4 @@ comment = 'determine similarities and distance between strings' ...@@ -3,3 +3,4 @@ comment = 'determine similarities and distance between strings'
default_version = '1.1' default_version = '1.1'
module_pathname = '$libdir/fuzzystrmatch' module_pathname = '$libdir/fuzzystrmatch'
relocatable = true relocatable = true
trusted = true
...@@ -3,3 +3,4 @@ comment = 'data type for storing sets of (key, value) pairs' ...@@ -3,3 +3,4 @@ comment = 'data type for storing sets of (key, value) pairs'
default_version = '1.6' default_version = '1.6'
module_pathname = '$libdir/hstore' module_pathname = '$libdir/hstore'
relocatable = true relocatable = true
trusted = true
...@@ -3,4 +3,5 @@ comment = 'transform between hstore and plperl' ...@@ -3,4 +3,5 @@ comment = 'transform between hstore and plperl'
default_version = '1.0' default_version = '1.0'
module_pathname = '$libdir/hstore_plperl' module_pathname = '$libdir/hstore_plperl'
relocatable = true relocatable = true
trusted = true
requires = 'hstore,plperl' requires = 'hstore,plperl'
...@@ -3,3 +3,4 @@ comment = 'functions, operators, and index support for 1-D arrays of integers' ...@@ -3,3 +3,4 @@ comment = 'functions, operators, and index support for 1-D arrays of integers'
default_version = '1.2' default_version = '1.2'
module_pathname = '$libdir/_int' module_pathname = '$libdir/_int'
relocatable = true relocatable = true
trusted = true
...@@ -3,3 +3,4 @@ comment = 'data types for international product numbering standards' ...@@ -3,3 +3,4 @@ comment = 'data types for international product numbering standards'
default_version = '1.2' default_version = '1.2'
module_pathname = '$libdir/isn' module_pathname = '$libdir/isn'
relocatable = true relocatable = true
trusted = true
...@@ -3,4 +3,5 @@ comment = 'transform between jsonb and plperl' ...@@ -3,4 +3,5 @@ comment = 'transform between jsonb and plperl'
default_version = '1.0' default_version = '1.0'
module_pathname = '$libdir/jsonb_plperl' module_pathname = '$libdir/jsonb_plperl'
relocatable = true relocatable = true
trusted = true
requires = 'plperl' requires = 'plperl'
...@@ -3,3 +3,4 @@ comment = 'Large Object maintenance' ...@@ -3,3 +3,4 @@ comment = 'Large Object maintenance'
default_version = '1.1' default_version = '1.1'
module_pathname = '$libdir/lo' module_pathname = '$libdir/lo'
relocatable = true relocatable = true
trusted = true
...@@ -3,3 +3,4 @@ comment = 'data type for hierarchical tree-like structures' ...@@ -3,3 +3,4 @@ comment = 'data type for hierarchical tree-like structures'
default_version = '1.1' default_version = '1.1'
module_pathname = '$libdir/ltree' module_pathname = '$libdir/ltree'
relocatable = true relocatable = true
trusted = true
...@@ -3,3 +3,4 @@ comment = 'text similarity measurement and index searching based on trigrams' ...@@ -3,3 +3,4 @@ comment = 'text similarity measurement and index searching based on trigrams'
default_version = '1.4' default_version = '1.4'
module_pathname = '$libdir/pg_trgm' module_pathname = '$libdir/pg_trgm'
relocatable = true relocatable = true
trusted = true
...@@ -3,3 +3,4 @@ comment = 'cryptographic functions' ...@@ -3,3 +3,4 @@ comment = 'cryptographic functions'
default_version = '1.3' default_version = '1.3'
module_pathname = '$libdir/pgcrypto' module_pathname = '$libdir/pgcrypto'
relocatable = true relocatable = true
trusted = true
...@@ -3,3 +3,4 @@ comment = 'data type for representing line segments or floating-point intervals' ...@@ -3,3 +3,4 @@ comment = 'data type for representing line segments or floating-point intervals'
default_version = '1.3' default_version = '1.3'
module_pathname = '$libdir/seg' module_pathname = '$libdir/seg'
relocatable = true relocatable = true
trusted = true
...@@ -3,3 +3,4 @@ comment = 'functions that manipulate whole tables, including crosstab' ...@@ -3,3 +3,4 @@ comment = 'functions that manipulate whole tables, including crosstab'
default_version = '1.0' default_version = '1.0'
module_pathname = '$libdir/tablefunc' module_pathname = '$libdir/tablefunc'
relocatable = true relocatable = true
trusted = true
...@@ -3,3 +3,4 @@ comment = 'Triggered change notifications' ...@@ -3,3 +3,4 @@ comment = 'Triggered change notifications'
default_version = '1.0' default_version = '1.0'
module_pathname = '$libdir/tcn' module_pathname = '$libdir/tcn'
relocatable = true relocatable = true
trusted = true
...@@ -3,3 +3,4 @@ comment = 'TABLESAMPLE method which accepts number of rows as a limit' ...@@ -3,3 +3,4 @@ comment = 'TABLESAMPLE method which accepts number of rows as a limit'
default_version = '1.0' default_version = '1.0'
module_pathname = '$libdir/tsm_system_rows' module_pathname = '$libdir/tsm_system_rows'
relocatable = true relocatable = true
trusted = true
...@@ -3,3 +3,4 @@ comment = 'TABLESAMPLE method which accepts time in milliseconds as a limit' ...@@ -3,3 +3,4 @@ comment = 'TABLESAMPLE method which accepts time in milliseconds as a limit'
default_version = '1.0' default_version = '1.0'
module_pathname = '$libdir/tsm_system_time' module_pathname = '$libdir/tsm_system_time'
relocatable = true relocatable = true
trusted = true
...@@ -3,3 +3,4 @@ comment = 'text search dictionary that removes accents' ...@@ -3,3 +3,4 @@ comment = 'text search dictionary that removes accents'
default_version = '1.1' default_version = '1.1'
module_pathname = '$libdir/unaccent' module_pathname = '$libdir/unaccent'
relocatable = true relocatable = true
trusted = true
...@@ -3,3 +3,4 @@ comment = 'generate universally unique identifiers (UUIDs)' ...@@ -3,3 +3,4 @@ comment = 'generate universally unique identifiers (UUIDs)'
default_version = '1.1' default_version = '1.1'
module_pathname = '$libdir/uuid-ossp' module_pathname = '$libdir/uuid-ossp'
relocatable = true relocatable = true
trusted = true
...@@ -32,6 +32,12 @@ ...@@ -32,6 +32,12 @@
two separate indexes that would have to be combined via bitmap ANDing. two separate indexes that would have to be combined via bitmap ANDing.
</para> </para>
<para>
This module is considered <quote>trusted</quote>, that is, it can be
installed by non-superusers who have <literal>CREATE</literal> privilege
on the current database.
</para>
<sect2> <sect2>
<title>Example Usage</title> <title>Example Usage</title>
......
...@@ -52,6 +52,12 @@ ...@@ -52,6 +52,12 @@
<type>oid</type>, and <type>money</type>. <type>oid</type>, and <type>money</type>.
</para> </para>
<para>
This module is considered <quote>trusted</quote>, that is, it can be
installed by non-superusers who have <literal>CREATE</literal> privilege
on the current database.
</para>
<sect2> <sect2>
<title>Example Usage</title> <title>Example Usage</title>
......
...@@ -24,6 +24,12 @@ ...@@ -24,6 +24,12 @@
</para> </para>
</tip> </tip>
<para>
This module is considered <quote>trusted</quote>, that is, it can be
installed by non-superusers who have <literal>CREATE</literal> privilege
on the current database.
</para>
<sect2> <sect2>
<title>Rationale</title> <title>Rationale</title>
......
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
Many modules supply new user-defined functions, operators, or types. Many modules supply new user-defined functions, operators, or types.
To make use of one of these modules, after you have installed the code To make use of one of these modules, after you have installed the code
you need to register the new SQL objects in the database system. you need to register the new SQL objects in the database system.
In <productname>PostgreSQL</productname> 9.1 and later, this is done by executing This is done by executing
a <xref linkend="sql-createextension"/> command. In a fresh database, a <xref linkend="sql-createextension"/> command. In a fresh database,
you can simply do you can simply do
...@@ -62,14 +62,23 @@ ...@@ -62,14 +62,23 @@
CREATE EXTENSION <replaceable>module_name</replaceable>; CREATE EXTENSION <replaceable>module_name</replaceable>;
</programlisting> </programlisting>
This command must be run by a database superuser. This registers the This command registers the new SQL objects in the current database only,
new SQL objects in the current database only, so you need to run this so you need to run it in each database that you want
command in each database that you want
the module's facilities to be available in. Alternatively, run it in the module's facilities to be available in. Alternatively, run it in
database <literal>template1</literal> so that the extension will be copied into database <literal>template1</literal> so that the extension will be copied into
subsequently-created databases by default. subsequently-created databases by default.
</para> </para>
<para>
For all these modules, <command>CREATE EXTENSION</command> must be run
by a database superuser, unless the module is
considered <quote>trusted</quote>, in which case it can be run by any
user who has <literal>CREATE</literal> privilege on the current
database. Modules that are trusted are identified as such in the
sections that follow. Generally, trusted modules are ones that cannot
provide access to outside-the-database functionality.
</para>
<para> <para>
Many modules allow you to install their objects in a schema of your Many modules allow you to install their objects in a schema of your
choice. To do that, add <literal>SCHEMA choice. To do that, add <literal>SCHEMA
......
...@@ -12,6 +12,12 @@ ...@@ -12,6 +12,12 @@
representing multidimensional cubes. representing multidimensional cubes.
</para> </para>
<para>
This module is considered <quote>trusted</quote>, that is, it can be
installed by non-superusers who have <literal>CREATE</literal> privilege
on the current database.
</para>
<sect2> <sect2>
<title>Syntax</title> <title>Syntax</title>
......
...@@ -15,6 +15,12 @@ ...@@ -15,6 +15,12 @@
unique words, which greatly affects the performance of searching. unique words, which greatly affects the performance of searching.
</para> </para>
<para>
This module is considered <quote>trusted</quote>, that is, it can be
installed by non-superusers who have <literal>CREATE</literal> privilege
on the current database.
</para>
<sect2> <sect2>
<title>Configuration</title> <title>Configuration</title>
......
...@@ -23,6 +23,12 @@ ...@@ -23,6 +23,12 @@
project.) project.)
</para> </para>
<para>
This module is considered <quote>trusted</quote>, that is, it can be
installed by non-superusers who have <literal>CREATE</literal> privilege
on the current database.
</para>
<sect2> <sect2>
<title>Cube-Based Earth Distances</title> <title>Cube-Based Earth Distances</title>
......
...@@ -20,6 +20,12 @@ ...@@ -20,6 +20,12 @@
</para> </para>
</caution> </caution>
<para>
This module is considered <quote>trusted</quote>, that is, it can be
installed by non-superusers who have <literal>CREATE</literal> privilege
on the current database.
</para>
<sect2> <sect2>
<title>Soundex</title> <title>Soundex</title>
......
...@@ -15,6 +15,12 @@ ...@@ -15,6 +15,12 @@
simply text strings. simply text strings.
</para> </para>
<para>
This module is considered <quote>trusted</quote>, that is, it can be
installed by non-superusers who have <literal>CREATE</literal> privilege
on the current database.
</para>
<sect2> <sect2>
<title><type>hstore</type> External Representation</title> <title><type>hstore</type> External Representation</title>
...@@ -633,6 +639,11 @@ ALTER TABLE tablename ALTER hstorecol TYPE hstore USING hstorecol || ''; ...@@ -633,6 +639,11 @@ ALTER TABLE tablename ALTER hstorecol TYPE hstore USING hstorecol || '';
convention). If you use them, <type>hstore</type> values are mapped to convention). If you use them, <type>hstore</type> values are mapped to
Python dictionaries. Python dictionaries.
</para> </para>
<para>
Of these additional extensions, <literal>hstore_plperl</literal> is
considered trusted; the rest are not.
</para>
</sect2> </sect2>
<sect2> <sect2>
......
...@@ -24,6 +24,12 @@ ...@@ -24,6 +24,12 @@
treated as though it were a linear array in storage order. treated as though it were a linear array in storage order.
</para> </para>
<para>
This module is considered <quote>trusted</quote>, that is, it can be
installed by non-superusers who have <literal>CREATE</literal> privilege
on the current database.
</para>
<sect2> <sect2>
<title><filename>intarray</filename> Functions and Operators</title> <title><filename>intarray</filename> Functions and Operators</title>
......
...@@ -21,6 +21,12 @@ ...@@ -21,6 +21,12 @@
dropped from a future version of this module. dropped from a future version of this module.
</para> </para>
<para>
This module is considered <quote>trusted</quote>, that is, it can be
installed by non-superusers who have <literal>CREATE</literal> privilege
on the current database.
</para>
<sect2> <sect2>
<title>Data Types</title> <title>Data Types</title>
......
...@@ -622,6 +622,13 @@ SELECT jdoc-&gt;'guid', jdoc-&gt;'name' FROM api WHERE jdoc @&gt; '{"tags": ["qu ...@@ -622,6 +622,13 @@ SELECT jdoc-&gt;'guid', jdoc-&gt;'name' FROM api WHERE jdoc @&gt; '{"tags": ["qu
use them, <type>jsonb</type> values are mapped to Python dictionaries, use them, <type>jsonb</type> values are mapped to Python dictionaries,
lists, and scalars, as appropriate. lists, and scalars, as appropriate.
</para> </para>
<para>
Of these extensions, <literal>jsonb_plperl</literal> is
considered <quote>trusted</quote>, that is, it can be installed by
non-superusers who have <literal>CREATE</literal> privilege on the
current database. The rest require superuser privilege to install.
</para>
</sect2> </sect2>
<sect2 id="datatype-jsonpath"> <sect2 id="datatype-jsonpath">
......
...@@ -13,6 +13,12 @@ ...@@ -13,6 +13,12 @@
and a trigger <function>lo_manage</function>. and a trigger <function>lo_manage</function>.
</para> </para>
<para>
This module is considered <quote>trusted</quote>, that is, it can be
installed by non-superusers who have <literal>CREATE</literal> privilege
on the current database.
</para>
<sect2> <sect2>
<title>Rationale</title> <title>Rationale</title>
......
...@@ -13,6 +13,12 @@ ...@@ -13,6 +13,12 @@
Extensive facilities for searching through label trees are provided. Extensive facilities for searching through label trees are provided.
</para> </para>
<para>
This module is considered <quote>trusted</quote>, that is, it can be
installed by non-superusers who have <literal>CREATE</literal> privilege
on the current database.
</para>
<sect2> <sect2>
<title>Definitions</title> <title>Definitions</title>
......
...@@ -17,6 +17,12 @@ ...@@ -17,6 +17,12 @@
<productname>PostgreSQL</productname>. <productname>PostgreSQL</productname>.
</para> </para>
<para>
This module is considered <quote>trusted</quote>, that is, it can be
installed by non-superusers who have <literal>CREATE</literal> privilege
on the current database.
</para>
<sect2> <sect2>
<title>General Hashing Functions</title> <title>General Hashing Functions</title>
......
...@@ -15,6 +15,12 @@ ...@@ -15,6 +15,12 @@
strings. strings.
</para> </para>
<para>
This module is considered <quote>trusted</quote>, that is, it can be
installed by non-superusers who have <literal>CREATE</literal> privilege
on the current database.
</para>
<sect2> <sect2>
<title>Trigram (or Trigraph) Concepts</title> <title>Trigram (or Trigraph) Concepts</title>
......
...@@ -14,6 +14,12 @@ ...@@ -14,6 +14,12 @@
making it especially useful for representing laboratory measurements. making it especially useful for representing laboratory measurements.
</para> </para>
<para>
This module is considered <quote>trusted</quote>, that is, it can be
installed by non-superusers who have <literal>CREATE</literal> privilege
on the current database.
</para>
<sect2> <sect2>
<title>Rationale</title> <title>Rationale</title>
......
...@@ -14,6 +14,12 @@ ...@@ -14,6 +14,12 @@
multiple rows. multiple rows.
</para> </para>
<para>
This module is considered <quote>trusted</quote>, that is, it can be
installed by non-superusers who have <literal>CREATE</literal> privilege
on the current database.
</para>
<sect2> <sect2>
<title>Functions Provided</title> <title>Functions Provided</title>
......
...@@ -17,6 +17,12 @@ ...@@ -17,6 +17,12 @@
used as an <literal>AFTER</literal> trigger <literal>FOR EACH ROW</literal>. used as an <literal>AFTER</literal> trigger <literal>FOR EACH ROW</literal>.
</para> </para>
<para>
This module is considered <quote>trusted</quote>, that is, it can be
installed by non-superusers who have <literal>CREATE</literal> privilege
on the current database.
</para>
<para> <para>
Only one parameter may be supplied to the function in a Only one parameter may be supplied to the function in a
<literal>CREATE TRIGGER</literal> statement, and that is optional. If supplied <literal>CREATE TRIGGER</literal> statement, and that is optional. If supplied
......
...@@ -33,6 +33,12 @@ ...@@ -33,6 +33,12 @@
the <literal>REPEATABLE</literal> clause. the <literal>REPEATABLE</literal> clause.
</para> </para>
<para>
This module is considered <quote>trusted</quote>, that is, it can be
installed by non-superusers who have <literal>CREATE</literal> privilege
on the current database.
</para>
<sect2> <sect2>
<title>Examples</title> <title>Examples</title>
......
...@@ -35,6 +35,12 @@ ...@@ -35,6 +35,12 @@
the <literal>REPEATABLE</literal> clause. the <literal>REPEATABLE</literal> clause.
</para> </para>
<para>
This module is considered <quote>trusted</quote>, that is, it can be
installed by non-superusers who have <literal>CREATE</literal> privilege
on the current database.
</para>
<sect2> <sect2>
<title>Examples</title> <title>Examples</title>
......
...@@ -21,6 +21,12 @@ ...@@ -21,6 +21,12 @@
normalizing dictionary for the <filename>thesaurus</filename> dictionary. normalizing dictionary for the <filename>thesaurus</filename> dictionary.
</para> </para>
<para>
This module is considered <quote>trusted</quote>, that is, it can be
installed by non-superusers who have <literal>CREATE</literal> privilege
on the current database.
</para>
<sect2> <sect2>
<title>Configuration</title> <title>Configuration</title>
......
...@@ -16,6 +16,12 @@ ...@@ -16,6 +16,12 @@
linkend="functions-uuid"/> for built-in ways to generate UUIDs. linkend="functions-uuid"/> for built-in ways to generate UUIDs.
</para> </para>
<para>
This module is considered <quote>trusted</quote>, that is, it can be
installed by non-superusers who have <literal>CREATE</literal> privilege
on the current database.
</para>
<sect2> <sect2>
<title><literal>uuid-ossp</literal> Functions</title> <title><literal>uuid-ossp</literal> Functions</title>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment