pgsql: Allow using the updated tuple while moving it to a different par

2018-07-12 Thread Amit Kapila
Allow using the updated tuple while moving it to a different partition. An update that causes the tuple to be moved to a different partition was missing out on re-constructing the to-be-updated tuple, based on the latest tuple in the update chain. Instead, it's simply deleting the latest tuple an

pgsql: Allow using the updated tuple while moving it to a different par

2018-07-12 Thread Amit Kapila
Allow using the updated tuple while moving it to a different partition. An update that causes the tuple to be moved to a different partition was missing out on re-constructing the to-be-updated tuple, based on the latest tuple in the update chain. Instead, it's simply deleting the latest tuple an

Re: pgsql: Allow using the updated tuple while moving it to a different par

2018-07-12 Thread Michael Paquier
On Thu, Jul 12, 2018 at 07:33:54AM +, Amit Kapila wrote: > Allow using the updated tuple while moving it to a different partition. > > An update that causes the tuple to be moved to a different partition was > missing out on re-constructing the to-be-updated tuple, based on the latest > tuple

Re: pgsql: Allow using the updated tuple while moving it to a different par

2018-07-12 Thread Amit Kapila
On Thu, Jul 12, 2018 at 1:29 PM, Michael Paquier wrote: > On Thu, Jul 12, 2018 at 07:33:54AM +, Amit Kapila wrote: >> Allow using the updated tuple while moving it to a different partition. >> >> An update that causes the tuple to be moved to a different partition was >> missing out on re-cons

pgsql: Add regression test for system catalog toast tables

2018-07-12 Thread Peter Eisentraut
Add regression test for system catalog toast tables For the moment, this just records which system catalogs have toast tables right now. Future patches will possibly change that set. from Tom Lane via Joe Conway Discussion: https://www.postgresql.org/message-id/flat/84ddff04-f122-784b-b6c5-353

pgsql: Improve two error messages

2018-07-12 Thread Peter Eisentraut
Improve two error messages Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/8e599897ca20fe31cb58fad0b401d7e317235024 Modified Files -- src/backend/parser/parse_utilcmd.c | 2 +- src/bin/pg_upgrade/check.c | 6 -- 2 files changed, 5 insertions(+)

pgsql: Doc: clarify release note text about v11's new window function f

2018-07-12 Thread Tom Lane
Doc: clarify release note text about v11's new window function features. Jonathan S. Katz Discussion: https://postgr.es/m/30468663-e67d-4753-8269-7e6a4001a...@excoventures.com Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/11a3aeeb5e174a3681f674e7e5ec9bbbc6430394

pgsql: Doc: update documentation for requirement of ORDER BY in GROUPS

2018-07-12 Thread Tom Lane
Doc: update documentation for requirement of ORDER BY in GROUPS mode. Commit ff4f88916 adjusted the code to enforce the SQL spec's requirement that a window using GROUPS mode must have an ORDER BY clause. But I missed that the documentation explicitly said you didn't have to have one. Also minor

pgsql: Doc: update documentation for requirement of ORDER BY in GROUPS

2018-07-12 Thread Tom Lane
Doc: update documentation for requirement of ORDER BY in GROUPS mode. Commit ff4f88916 adjusted the code to enforce the SQL spec's requirement that a window using GROUPS mode must have an ORDER BY clause. But I missed that the documentation explicitly said you didn't have to have one. Also minor

pgsql: Doc: clarify release note text about v11's new window function f

2018-07-12 Thread Tom Lane
Doc: clarify release note text about v11's new window function features. Jonathan S. Katz Discussion: https://postgr.es/m/30468663-e67d-4753-8269-7e6a4001a...@excoventures.com Branch -- REL_11_STABLE Details --- https://git.postgresql.org/pg/commitdiff/510421c45fb41869969a708a8c03c1279

pgsql: Fix FK checks of TRUNCATE involving partitioned tables

2018-07-12 Thread Alvaro Herrera
Fix FK checks of TRUNCATE involving partitioned tables When truncating a table that is referenced by foreign keys in partitioned tables, the check to ensure the referencing table are also truncated spuriously failed. This is because it was relying on relhastriggers as a proxy for the table having

pgsql: Fix FK checks of TRUNCATE involving partitioned tables

2018-07-12 Thread Alvaro Herrera
Fix FK checks of TRUNCATE involving partitioned tables When truncating a table that is referenced by foreign keys in partitioned tables, the check to ensure the referencing table are also truncated spuriously failed. This is because it was relying on relhastriggers as a proxy for the table having

pgsql: Doc: minor improvement in pl/pgsql FETCH/MOVE documentation.

2018-07-12 Thread Tom Lane
Doc: minor improvement in pl/pgsql FETCH/MOVE documentation. Explain that you can use any integer expression for the "count" in pl/pgsql's versions of FETCH/MOVE, unlike the SQL versions which only allow a constant. Remove the duplicate version of this para under MOVE. I don't see a good reason

pgsql: Doc: minor improvement in pl/pgsql FETCH/MOVE documentation.

2018-07-12 Thread Tom Lane
Doc: minor improvement in pl/pgsql FETCH/MOVE documentation. Explain that you can use any integer expression for the "count" in pl/pgsql's versions of FETCH/MOVE, unlike the SQL versions which only allow a constant. Remove the duplicate version of this para under MOVE. I don't see a good reason

pgsql: Doc: minor improvement in pl/pgsql FETCH/MOVE documentation.

2018-07-12 Thread Tom Lane
Doc: minor improvement in pl/pgsql FETCH/MOVE documentation. Explain that you can use any integer expression for the "count" in pl/pgsql's versions of FETCH/MOVE, unlike the SQL versions which only allow a constant. Remove the duplicate version of this para under MOVE. I don't see a good reason

pgsql: Doc: minor improvement in pl/pgsql FETCH/MOVE documentation.

2018-07-12 Thread Tom Lane
Doc: minor improvement in pl/pgsql FETCH/MOVE documentation. Explain that you can use any integer expression for the "count" in pl/pgsql's versions of FETCH/MOVE, unlike the SQL versions which only allow a constant. Remove the duplicate version of this para under MOVE. I don't see a good reason

pgsql: Doc: minor improvement in pl/pgsql FETCH/MOVE documentation.

2018-07-12 Thread Tom Lane
Doc: minor improvement in pl/pgsql FETCH/MOVE documentation. Explain that you can use any integer expression for the "count" in pl/pgsql's versions of FETCH/MOVE, unlike the SQL versions which only allow a constant. Remove the duplicate version of this para under MOVE. I don't see a good reason

pgsql: Doc: minor improvement in pl/pgsql FETCH/MOVE documentation.

2018-07-12 Thread Tom Lane
Doc: minor improvement in pl/pgsql FETCH/MOVE documentation. Explain that you can use any integer expression for the "count" in pl/pgsql's versions of FETCH/MOVE, unlike the SQL versions which only allow a constant. Remove the duplicate version of this para under MOVE. I don't see a good reason

pgsql: Doc: minor improvement in pl/pgsql FETCH/MOVE documentation.

2018-07-12 Thread Tom Lane
Doc: minor improvement in pl/pgsql FETCH/MOVE documentation. Explain that you can use any integer expression for the "count" in pl/pgsql's versions of FETCH/MOVE, unlike the SQL versions which only allow a constant. Remove the duplicate version of this para under MOVE. I don't see a good reason

pgsql: Reset shmem_exit_inprogress after shmem_exit()

2018-07-12 Thread Peter Eisentraut
Reset shmem_exit_inprogress after shmem_exit() In ad9a274778d2d88c46b90309212b92ee7fdf9afe, shmem_exit_inprogress was introduced. But we need to reset it after shmem_exit(), because unlike the similar proc_exit(), shmem_exit() can also be called for cleanup when the process will not exit. Report

pgsql: Reset shmem_exit_inprogress after shmem_exit()

2018-07-12 Thread Peter Eisentraut
Reset shmem_exit_inprogress after shmem_exit() In ad9a274778d2d88c46b90309212b92ee7fdf9afe, shmem_exit_inprogress was introduced. But we need to reset it after shmem_exit(), because unlike the similar proc_exit(), shmem_exit() can also be called for cleanup when the process will not exit. Report

pgsql: Clean up temporary WAL segments after an instance crash

2018-07-12 Thread Michael Paquier
Clean up temporary WAL segments after an instance crash Temporary WAL segments are created in pg_wal and named as xlogtemp.pid before being renamed to the real deal when creating a new segment. If an instance crashes after the temporary segment is created and before the rename is done, then the s

Re: pgsql: Allow using the updated tuple while moving it to a different par

2018-07-12 Thread Tom Lane
Amit Kapila writes: > On Thu, Jul 12, 2018 at 1:29 PM, Michael Paquier wrote: >> Looks unrelated, but flaviventris (a snake?) has just complained: >> https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=flaviventris&dt=2018-07-12%2007%3A36%3A01 > Yeah, I am confused as to how this commit can

pgsql: Fix argument of pg_create_logical_replication_slot for slot name

2018-07-12 Thread Michael Paquier
Fix argument of pg_create_logical_replication_slot for slot name All attributes and arguments using a slot name map to the data type "name", but this function has been using "text". This is cosmetic, as even if text is used then the slot name would be truncated to 64 characters anyway and stored

pgsql: Add pg_dump --on-conflict-do-nothing option.

2018-07-12 Thread Thomas Munro
Add pg_dump --on-conflict-do-nothing option. When dumping INSERT statements, optionally add ON CONFLICT DO NOTHING. Author: Surafel Temesgen Reviewed-by: Takeshi Ideriha, Nico Williams, Dilip Kumar Discussion: https://postgr.es/m/CALAY4q-PQ9cOEzs2%2BQHK5ObfF_4QbmBaYXbZx6BGGN66Q-n8FA%40mail.gmail

pgsql: Accept invalidation messages in InitializeSessionUserId().

2018-07-12 Thread Thomas Munro
Accept invalidation messages in InitializeSessionUserId(). If the authentication method modified the system catalogs through a separate database connection (say, to create a new role on the fly), make sure syscache sees the changes before we try to find the user. Author: Thomas Munro Reviewed-by: