pgsql: Fix typos in code and comments

2023-01-10 Thread Michael Paquier
Fix typos in code and comments Author: Justin Pryzby Discussion: https://postgr.es/m/[email protected] Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/5f6401f81cb24bd3930e0dc589fc4aa8b5424cdc Modified Files -- doc/src/sgml/ref/alter_da

pgsql: Remove function declarations from headers for some undefined fun

2023-01-10 Thread Michael Paquier
Remove function declarations from headers for some undefined functions The functions whose declarations are removed here have been removed in the past, but their respective headers forgot the call. Author: Justin Pryzby Discussion: https://postgr.es/m/[email protected] Branch -

Re: pgsql: Add new GUC createrole_self_grant.

2023-01-10 Thread Tom Lane
Robert Haas writes: > Add new GUC createrole_self_grant. > Can be set to the empty string, or to either or both of "set" or > "inherit". If set to a non-empty value, a non-superuser who creates > a role (necessarily by relying up the CREATEROLE privilege) will > grant that role back to themselves

pgsql: Avoid using tuple from syscache for update of pg_database.datfro

2023-01-10 Thread Michael Paquier
Avoid using tuple from syscache for update of pg_database.datfrozenxid pg_database.datfrozenxid gets updated using an in-place update at the end of vacuum or autovacuum. Since 96cdeae, as pg_database has a toast relation, it is possible for a pg_database tuple to have toast values if there is a l

pgsql: Avoid using tuple from syscache for update of pg_database.datfro

2023-01-10 Thread Michael Paquier
Avoid using tuple from syscache for update of pg_database.datfrozenxid pg_database.datfrozenxid gets updated using an in-place update at the end of vacuum or autovacuum. Since 96cdeae, as pg_database has a toast relation, it is possible for a pg_database tuple to have toast values if there is a l

pgsql: Have the planner consider Incremental Sort for DISTINCT

2023-01-10 Thread David Rowley
Have the planner consider Incremental Sort for DISTINCT Prior to this, we only considered a full sort on the cheapest input path and uniquifying any path which was already sorted in the required sort order. Here we adjust create_final_distinct_paths() so that it also adds an Incremental Sort path

pgsql: Add new GUC createrole_self_grant.

2023-01-10 Thread Robert Haas
Add new GUC createrole_self_grant. Can be set to the empty string, or to either or both of "set" or "inherit". If set to a non-empty value, a non-superuser who creates a role (necessarily by relying up the CREATEROLE privilege) will grant that role back to themselves with the specified options. T

pgsql: Restrict the privileges of CREATEROLE users.

2023-01-10 Thread Robert Haas
Restrict the privileges of CREATEROLE users. Previously, CREATEROLE users were permitted to make nearly arbitrary changes to roles that they didn't create, with certain exceptions, particularly superuser roles. Instead, allow CREATEROLE users to make such changes to roles for which they possess A

Re: pgsql: Fix the display of lock information for specktoken.

2023-01-10 Thread Amit Kapila
On Tue, Jan 10, 2023 at 6:10 PM Erik Rijkers wrote: > > On 1/10/23 04:34, Amit Kapila wrote: > > Fix the display of lock information for specktoken. > > > > A transaction id is now displayed in the transactionid field and > > speculative insertion token is displayed in the objid field. > > Hi, > >

pgsql: Fix MERGE's test for unreachable WHEN clauses.

2023-01-10 Thread Dean Rasheed
Fix MERGE's test for unreachable WHEN clauses. The former code would only detect an unreachable WHEN clause if it had an AND condition. Fix, so that unreachable unconditional WHEN clauses are also detected. Back-patch to v15, where MERGE was added. Discussion: https://postgr.es/m/CAEZATCVQ=7E2z

pgsql: Fix MERGE's test for unreachable WHEN clauses.

2023-01-10 Thread Dean Rasheed
Fix MERGE's test for unreachable WHEN clauses. The former code would only detect an unreachable WHEN clause if it had an AND condition. Fix, so that unreachable unconditional WHEN clauses are also detected. Back-patch to v15, where MERGE was added. Discussion: https://postgr.es/m/CAEZATCVQ=7E2z

Re: pgsql: Fix the display of lock information for specktoken.

2023-01-10 Thread Erik Rijkers
On 1/10/23 04:34, Amit Kapila wrote: Fix the display of lock information for specktoken. A transaction id is now displayed in the transactionid field and speculative insertion token is displayed in the objid field. Hi, 'A specualtive insertion lock' should be 'A speculative insertion lock'