Compare commits

..

No commits in common. "151ffcf6d8c1a527fa3abc27b1a13c0d43be494e" and "b690e5facb4fbd2600dc477cfe64415538d306cc" have entirely different histories.

13 changed files with 86 additions and 154 deletions

View File

@ -73,35 +73,6 @@
however; see the <xref linkend="guc-hba-file"/> configuration parameter. however; see the <xref linkend="guc-hba-file"/> configuration parameter.
</para> </para>
<para>
The <filename>pg_hba.conf</filename> file is read on start-up and when
the main server process receives a
<systemitem>SIGHUP</systemitem><indexterm><primary>SIGHUP</primary></indexterm>
signal. If you edit the file on an
active system, you will need to signal the postmaster
(using <literal>pg_ctl reload</literal>, calling the SQL function
<function>pg_reload_conf()</function>, or using <literal>kill
-HUP</literal>) to make it re-read the file.
</para>
<note>
<para>
The preceding statement is not true on Microsoft Windows: there, any
changes in the <filename>pg_hba.conf</filename> file are immediately
applied by subsequent new connections.
</para>
</note>
<para>
The system view
<link linkend="view-pg-hba-file-rules"><structname>pg_hba_file_rules</structname></link>
can be helpful for pre-testing changes to the <filename>pg_hba.conf</filename>
file, or for diagnosing problems if loading of the file did not have the
desired effects. Rows in the view with
non-null <structfield>error</structfield> fields indicate problems in the
corresponding lines of the file.
</para>
<para> <para>
The general format of the <filename>pg_hba.conf</filename> file is The general format of the <filename>pg_hba.conf</filename> file is
a set of records, one per line. Blank lines are ignored, as is any a set of records, one per line. Blank lines are ignored, as is any
@ -762,6 +733,35 @@ openssl x509 -in myclient.crt -noout --subject -nameopt RFC2253 | sed "s/^subjec
range of allowed client IP addresses. range of allowed client IP addresses.
</para> </para>
<para>
The <filename>pg_hba.conf</filename> file is read on start-up and when
the main server process receives a
<systemitem>SIGHUP</systemitem><indexterm><primary>SIGHUP</primary></indexterm>
signal. If you edit the file on an
active system, you will need to signal the postmaster
(using <literal>pg_ctl reload</literal>, calling the SQL function
<function>pg_reload_conf()</function>, or using <literal>kill
-HUP</literal>) to make it re-read the file.
</para>
<note>
<para>
The preceding statement is not true on Microsoft Windows: there, any
changes in the <filename>pg_hba.conf</filename> file are immediately
applied by subsequent new connections.
</para>
</note>
<para>
The system view
<link linkend="view-pg-hba-file-rules"><structname>pg_hba_file_rules</structname></link>
can be helpful for pre-testing changes to the <filename>pg_hba.conf</filename>
file, or for diagnosing problems if loading of the file did not have the
desired effects. Rows in the view with
non-null <structfield>error</structfield> fields indicate problems in the
corresponding lines of the file.
</para>
<tip> <tip>
<para> <para>
To connect to a particular database, a user must not only pass the To connect to a particular database, a user must not only pass the
@ -933,28 +933,6 @@ local db1,db2,@demodbs all md5
As for <filename>pg_hba.conf</filename>, the lines in this file can As for <filename>pg_hba.conf</filename>, the lines in this file can
be include directives, following the same rules. be include directives, following the same rules.
</para> </para>
<para>
The <filename>pg_ident.conf</filename> file is read on start-up and
when the main server process receives a
<systemitem>SIGHUP</systemitem><indexterm><primary>SIGHUP</primary></indexterm>
signal. If you edit the file on an
active system, you will need to signal the postmaster
(using <literal>pg_ctl reload</literal>, calling the SQL function
<function>pg_reload_conf()</function>, or using <literal>kill
-HUP</literal>) to make it re-read the file.
</para>
<para>
The system view
<link linkend="view-pg-ident-file-mappings"><structname>pg_ident_file_mappings</structname></link>
can be helpful for pre-testing changes to the
<filename>pg_ident.conf</filename> file, or for diagnosing problems if
loading of the file did not have the desired effects. Rows in the view with
non-null <structfield>error</structfield> fields indicate problems in the
corresponding lines of the file.
</para>
<para> <para>
There is no restriction regarding how many database users a given There is no restriction regarding how many database users a given
operating system user can correspond to, nor vice versa. Thus, entries operating system user can correspond to, nor vice versa. Thus, entries
@ -1021,6 +999,27 @@ mymap /^(.*)@otherdomain\.com$ guest
</para> </para>
</tip> </tip>
<para>
The <filename>pg_ident.conf</filename> file is read on start-up and
when the main server process receives a
<systemitem>SIGHUP</systemitem><indexterm><primary>SIGHUP</primary></indexterm>
signal. If you edit the file on an
active system, you will need to signal the postmaster
(using <literal>pg_ctl reload</literal>, calling the SQL function
<function>pg_reload_conf()</function>, or using <literal>kill
-HUP</literal>) to make it re-read the file.
</para>
<para>
The system view
<link linkend="view-pg-ident-file-mappings"><structname>pg_ident_file_mappings</structname></link>
can be helpful for pre-testing changes to the
<filename>pg_ident.conf</filename> file, or for diagnosing problems if
loading of the file did not have the desired effects. Rows in the view with
non-null <structfield>error</structfield> fields indicate problems in the
corresponding lines of the file.
</para>
<para> <para>
A <filename>pg_ident.conf</filename> file that could be used in A <filename>pg_ident.conf</filename> file that could be used in
conjunction with the <filename>pg_hba.conf</filename> file in <xref conjunction with the <filename>pg_hba.conf</filename> file in <xref

View File

@ -20288,13 +20288,6 @@ SELECT NULLIF(value, '(none)') ...
aggregation. aggregation.
</para> </para>
<para>
While all aggregates below accept an optional
<literal>ORDER BY</literal> clause (as outlined in <xref
linkend="syntax-aggregates"/>), the clause has only been added to
aggregates whose output is affected by ordering.
</para>
<table id="functions-aggregate-table"> <table id="functions-aggregate-table">
<title>General-Purpose Aggregate Functions</title> <title>General-Purpose Aggregate Functions</title>
<tgroup cols="2"> <tgroup cols="2">
@ -20332,7 +20325,7 @@ SELECT NULLIF(value, '(none)') ...
<indexterm> <indexterm>
<primary>array_agg</primary> <primary>array_agg</primary>
</indexterm> </indexterm>
<function>array_agg</function> ( <type>anynonarray</type> <literal>ORDER BY</literal> <literal>input_sort_columns</literal> ) <function>array_agg</function> ( <type>anynonarray</type> )
<returnvalue>anyarray</returnvalue> <returnvalue>anyarray</returnvalue>
</para> </para>
<para> <para>
@ -20343,7 +20336,7 @@ SELECT NULLIF(value, '(none)') ...
<row> <row>
<entry role="func_table_entry"><para role="func_signature"> <entry role="func_table_entry"><para role="func_signature">
<function>array_agg</function> ( <type>anyarray</type> <literal>ORDER BY</literal> <literal>input_sort_columns</literal> ) <function>array_agg</function> ( <type>anyarray</type> )
<returnvalue>anyarray</returnvalue> <returnvalue>anyarray</returnvalue>
</para> </para>
<para> <para>
@ -20548,14 +20541,14 @@ SELECT NULLIF(value, '(none)') ...
<indexterm> <indexterm>
<primary>json_agg</primary> <primary>json_agg</primary>
</indexterm> </indexterm>
<function>json_agg</function> ( <type>anyelement</type> <literal>ORDER BY</literal> <literal>input_sort_columns</literal> ) <function>json_agg</function> ( <type>anyelement</type> )
<returnvalue>json</returnvalue> <returnvalue>json</returnvalue>
</para> </para>
<para role="func_signature"> <para role="func_signature">
<indexterm> <indexterm>
<primary>jsonb_agg</primary> <primary>jsonb_agg</primary>
</indexterm> </indexterm>
<function>jsonb_agg</function> ( <type>anyelement</type> <literal>ORDER BY</literal> <literal>input_sort_columns</literal> ) <function>jsonb_agg</function> ( <type>anyelement</type> )
<returnvalue>jsonb</returnvalue> <returnvalue>jsonb</returnvalue>
</para> </para>
<para> <para>
@ -20595,8 +20588,7 @@ SELECT NULLIF(value, '(none)') ...
</indexterm> </indexterm>
<function>json_object_agg</function> ( <parameter>key</parameter> <function>json_object_agg</function> ( <parameter>key</parameter>
<type>"any"</type>, <parameter>value</parameter> <type>"any"</type>, <parameter>value</parameter>
<type>"any"</type> <type>"any"</type> )
<literal>ORDER BY</literal> <literal>input_sort_columns</literal> )
<returnvalue>json</returnvalue> <returnvalue>json</returnvalue>
</para> </para>
<para role="func_signature"> <para role="func_signature">
@ -20605,8 +20597,7 @@ SELECT NULLIF(value, '(none)') ...
</indexterm> </indexterm>
<function>jsonb_object_agg</function> ( <parameter>key</parameter> <function>jsonb_object_agg</function> ( <parameter>key</parameter>
<type>"any"</type>, <parameter>value</parameter> <type>"any"</type>, <parameter>value</parameter>
<type>"any"</type> <type>"any"</type> )
<literal>ORDER BY</literal> <literal>input_sort_columns</literal> )
<returnvalue>jsonb</returnvalue> <returnvalue>jsonb</returnvalue>
</para> </para>
<para> <para>
@ -20843,8 +20834,7 @@ SELECT NULLIF(value, '(none)') ...
</para> </para>
<para role="func_signature"> <para role="func_signature">
<function>string_agg</function> ( <parameter>value</parameter> <function>string_agg</function> ( <parameter>value</parameter>
<type>bytea</type>, <parameter>delimiter</parameter> <type>bytea</type> <type>bytea</type>, <parameter>delimiter</parameter> <type>bytea</type> )
<literal>ORDER BY</literal> <literal>input_sort_columns</literal> )
<returnvalue>bytea</returnvalue> <returnvalue>bytea</returnvalue>
</para> </para>
<para> <para>
@ -20902,7 +20892,7 @@ SELECT NULLIF(value, '(none)') ...
<indexterm> <indexterm>
<primary>xmlagg</primary> <primary>xmlagg</primary>
</indexterm> </indexterm>
<function>xmlagg</function> ( <type>xml</type> <literal>ORDER BY</literal> <literal>input_sort_columns</literal> ) <function>xmlagg</function> ( <type>xml</type> )
<returnvalue>xml</returnvalue> <returnvalue>xml</returnvalue>
</para> </para>
<para> <para>

View File

@ -213,12 +213,6 @@ createdb -O <replaceable>rolename</replaceable> <replaceable>dbname</replaceable
action being taken when those databases are created. action being taken when those databases are created.
</para> </para>
<para>
However, <command>CREATE DATABASE</command> does not copy database-level
<command>GRANT</command> permissions attached to the source database.
The new database has default database-level permissions.
</para>
<para> <para>
There is a second standard system database named There is a second standard system database named
<literal>template0</literal>.<indexterm><primary>template0</primary></indexterm> This <literal>template0</literal>.<indexterm><primary>template0</primary></indexterm> This

View File

@ -225,10 +225,9 @@ if docs_dep.found()
install_doc_man = custom_target('install-man', install_doc_man = custom_target('install-man',
output: 'install-man', output: 'install-man',
input: man,
command: [ command: [
python, install_files, '--prefix', dir_prefix, python, install_files, '--prefix', dir_prefix,
'--install-dirs', dir_man, '@INPUT@'], '--install-dirs', dir_man, man],
build_always_stale: true, build_by_default: false, build_always_stale: true, build_by_default: false,
) )
alias_target('install-doc-man', install_doc_man) alias_target('install-doc-man', install_doc_man)

View File

@ -137,11 +137,7 @@ REVOKE [ GRANT OPTION FOR ]
<listitem> <listitem>
<para> <para>
The name of an existing role of which the current role is a member. The name of an existing role of which the current role is a member.
Default access privileges are not inherited, so member roles If <literal>FOR ROLE</literal> is omitted, the current role is assumed.
must use <command>SET ROLE</command> to access these privileges,
or <command>ALTER DEFAULT PRIVILEGES</command> must be run for
each member role. If <literal>FOR ROLE</literal> is omitted,
the current role is assumed.
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>

View File

@ -59,16 +59,15 @@ CREATE [ OR REPLACE ] RULE <replaceable class="parameter">name</replaceable> AS
</para> </para>
<para> <para>
Presently, <literal>ON SELECT</literal> rules can only be attached Presently, <literal>ON SELECT</literal> rules must be unconditional
to views. Such a rule must be named <literal>"_RETURN"</literal>, <literal>INSTEAD</literal> rules and must have actions that consist
must be an unconditional <literal>INSTEAD</literal> rule, and must have of a single <command>SELECT</command> command. Thus, an
an action that consists of a single <command>SELECT</command> command. <literal>ON SELECT</literal> rule effectively turns the table into
This command defines the visible contents of the view. (The view a view, whose visible contents are the rows returned by the rule's
itself is basically a dummy table with no storage.) It's best to <command>SELECT</command> command rather than whatever had been
regard such a rule as an implementation detail. While a view can be stored in the table (if anything). It is considered better style
redefined via <literal>CREATE OR REPLACE RULE "_RETURN" AS to write a <command>CREATE VIEW</command> command than to create a
...</literal>, it's better style to use <literal>CREATE OR REPLACE real table and define an <literal>ON SELECT</literal> rule for it.
VIEW</literal>.
</para> </para>
<para> <para>

View File

@ -1119,10 +1119,6 @@ INSERT INTO tbl1 VALUES ($1, $2) \bind 'first value' 'second value' \g
destination, because all data must pass through the client/server destination, because all data must pass through the client/server
connection. For large amounts of data the <acronym>SQL</acronym> connection. For large amounts of data the <acronym>SQL</acronym>
command might be preferable. command might be preferable.
Also, because of this pass-through method, <literal>\copy
... from</literal> in <acronym>CSV</acronym> mode will erroneously
treat a <literal>\.</literal> data value alone on a line as an
end-of-input marker.
</para> </para>
</tip> </tip>

View File

@ -1647,20 +1647,7 @@ sqrt(2)
are always just expressions and cannot be output-column names or numbers. are always just expressions and cannot be output-column names or numbers.
For example: For example:
<programlisting> <programlisting>
WITH vals (v) AS ( VALUES (1),(3),(4),(3),(2) ) SELECT array_agg(a ORDER BY b DESC) FROM table;
SELECT array_agg(v ORDER BY v DESC) FROM vals;
array_agg
-------------
{4,3,3,2,1}
</programlisting>
Since <type>jsonb</type> only keeps the last matching key, ordering
of its keys can be significant:
<programlisting>
WITH vals (k, v) AS ( VALUES ('key0','1'), ('key1','3'), ('key1','2') )
SELECT jsonb_object_agg(k, v ORDER BY v) FROM vals;
jsonb_object_agg
----------------------------
{"key0": "1", "key1": "3"}
</programlisting> </programlisting>
</para> </para>
@ -1681,19 +1668,20 @@ SELECT string_agg(a ORDER BY a, ',') FROM table; -- incorrect
</para> </para>
<para> <para>
If <literal>DISTINCT</literal> is specified with an If <literal>DISTINCT</literal> is specified in addition to an
<replaceable>order_by_clause</replaceable>, <literal>ORDER <replaceable>order_by_clause</replaceable>, then all the <literal>ORDER BY</literal>
BY</literal> expressions can only reference columns in the expressions must match regular arguments of the aggregate; that is,
<literal>DISTINCT</literal> list. For example: you cannot sort on an expression that is not included in the
<programlisting> <literal>DISTINCT</literal> list.
WITH vals (v) AS ( VALUES (1),(3),(4),(3),(2) )
SELECT array_agg(DISTINCT v ORDER BY v DESC) FROM vals;
array_agg
-----------
{4,3,2,1}
</programlisting>
</para> </para>
<note>
<para>
The ability to specify both <literal>DISTINCT</literal> and <literal>ORDER BY</literal>
in an aggregate function is a <productname>PostgreSQL</productname> extension.
</para>
</note>
<para> <para>
Placing <literal>ORDER BY</literal> within the aggregate's regular argument Placing <literal>ORDER BY</literal> within the aggregate's regular argument
list, as described so far, is used when ordering the input rows for list, as described so far, is used when ordering the input rows for

View File

@ -324,7 +324,7 @@ recurse_set_operations(Node *setOp, PlannerInfo *root,
* anyway; otherwise do statistical estimation. * anyway; otherwise do statistical estimation.
* *
* XXX you don't really want to know about this: we do the estimation * XXX you don't really want to know about this: we do the estimation
* using the subroot->parse's original targetlist expressions, not the * using the subquery's original targetlist expressions, not the
* subroot->processed_tlist which might seem more appropriate. The * subroot->processed_tlist which might seem more appropriate. The
* reason is that if the subquery is itself a setop, it may return a * reason is that if the subquery is itself a setop, it may return a
* processed_tlist containing "varno 0" Vars generated by * processed_tlist containing "varno 0" Vars generated by
@ -332,9 +332,6 @@ recurse_set_operations(Node *setOp, PlannerInfo *root,
* mightily. We ought to get rid of the "varno 0" hack, but that * mightily. We ought to get rid of the "varno 0" hack, but that
* requires a redesign of the parsetree representation of setops, so * requires a redesign of the parsetree representation of setops, so
* that there can be an RTE corresponding to each setop's output. * that there can be an RTE corresponding to each setop's output.
* Note, we use this not subquery's targetlist but subroot->parse's
* targetlist, because it was revised by self-join removal. subquery's
* targetlist might contain the references to the removed relids.
*/ */
if (pNumGroups) if (pNumGroups)
{ {
@ -344,7 +341,7 @@ recurse_set_operations(Node *setOp, PlannerInfo *root,
*pNumGroups = subpath->rows; *pNumGroups = subpath->rows;
else else
*pNumGroups = estimate_num_groups(subroot, *pNumGroups = estimate_num_groups(subroot,
get_tlist_exprs(subroot->parse->targetList, false), get_tlist_exprs(subquery->targetList, false),
subpath->rows, subpath->rows,
NULL, NULL,
NULL); NULL);

View File

@ -627,8 +627,6 @@ handleCopyIn(PGconn *conn, FILE *copystream, bool isbinary, PGresult **res)
* This code erroneously assumes '\.' on a line alone * This code erroneously assumes '\.' on a line alone
* inside a quoted CSV string terminates the \copy. * inside a quoted CSV string terminates the \copy.
* https://www.postgresql.org/message-id/E1TdNVQ-0001ju-GO@wrigleys.postgresql.org * https://www.postgresql.org/message-id/E1TdNVQ-0001ju-GO@wrigleys.postgresql.org
*
* https://www.postgresql.org/message-id/bfcd57e4-8f23-4c3e-a5db-2571d09208e2@beta.fastmail.com
*/ */
if ((linelen == 3 && memcmp(fgresult, "\\.\n", 3) == 0) || if ((linelen == 3 && memcmp(fgresult, "\\.\n", 3) == 0) ||
(linelen == 4 && memcmp(fgresult, "\\.\r\n", 4) == 0)) (linelen == 4 && memcmp(fgresult, "\\.\r\n", 4) == 0))

View File

@ -6759,23 +6759,6 @@ WHERE c3.id=c2.id AND c3.id*c2.id=c1.id*c1.id;
Filter: ((id IS NOT NULL) AND ((id * id) IS NOT NULL)) Filter: ((id IS NOT NULL) AND ((id * id) IS NOT NULL))
(3 rows) (3 rows)
-- Check the usage of a parse tree by the set operations (bug #18170)
explain (costs off)
SELECT c1.code FROM emp1 c1 LEFT JOIN emp1 c2 ON c1.id = c2.id
WHERE c2.id IS NOT NULL
EXCEPT ALL
SELECT c3.code FROM emp1 c3;
QUERY PLAN
----------------------------------------------
HashSetOp Except All
-> Append
-> Subquery Scan on "*SELECT* 1"
-> Seq Scan on emp1 c2
Filter: (id IS NOT NULL)
-> Subquery Scan on "*SELECT* 2"
-> Seq Scan on emp1 c3
(7 rows)
-- We can remove the join even if we find the join can't duplicate rows and -- We can remove the join even if we find the join can't duplicate rows and
-- the base quals of each side are different. In the following case we end up -- the base quals of each side are different. In the following case we end up
-- moving quals over to s1 to make it so it can't match any rows. -- moving quals over to s1 to make it so it can't match any rows.

View File

@ -2573,13 +2573,6 @@ explain (costs off)
SELECT count(*) FROM emp1 c1, emp1 c2, emp1 c3 SELECT count(*) FROM emp1 c1, emp1 c2, emp1 c3
WHERE c3.id=c2.id AND c3.id*c2.id=c1.id*c1.id; WHERE c3.id=c2.id AND c3.id*c2.id=c1.id*c1.id;
-- Check the usage of a parse tree by the set operations (bug #18170)
explain (costs off)
SELECT c1.code FROM emp1 c1 LEFT JOIN emp1 c2 ON c1.id = c2.id
WHERE c2.id IS NOT NULL
EXCEPT ALL
SELECT c3.code FROM emp1 c3;
-- We can remove the join even if we find the join can't duplicate rows and -- We can remove the join even if we find the join can't duplicate rows and
-- the base quals of each side are different. In the following case we end up -- the base quals of each side are different. In the following case we end up
-- moving quals over to s1 to make it so it can't match any rows. -- moving quals over to s1 to make it so it can't match any rows.

View File

@ -140,8 +140,8 @@ sub mkvcbuild
f2s.c file_perm.c file_utils.c hashfn.c ip.c jsonapi.c f2s.c file_perm.c file_utils.c hashfn.c ip.c jsonapi.c
keywords.c kwlookup.c link-canary.c md5_common.c percentrepl.c keywords.c kwlookup.c link-canary.c md5_common.c percentrepl.c
pg_get_line.c pg_lzcompress.c pg_prng.c pgfnames.c psprintf.c relpath.c pg_get_line.c pg_lzcompress.c pg_prng.c pgfnames.c psprintf.c relpath.c
rmtree.c saslprep.c scram-common.c string.c stringinfo.c rmtree.c saslprep.c scram-common.c string.c stringinfo.c unicode_norm.c
unicode_category.c unicode_norm.c username.c wait_error.c wchar.c); username.c wait_error.c wchar.c);
if ($solution->{options}->{openssl}) if ($solution->{options}->{openssl})
{ {