- 26 Apr, 2021 8 commits
-
-
Alvaro Herrera authored
New keywords per 71f4c8c6. Discussion: https://postgr.es/m/20210422204035.GA25929@alvherre.pgsql
-
Tom Lane authored
Commit 2ec993a7, which added triggers on views, modified the rewriter to add dummy entries like "SET x = x" for all columns that weren't actually being updated by the user in any UPDATE directed at a view. That was needed at the time to produce a complete "NEW" row to pass to the trigger. Later it was found to cause problems for ordinary updatable views, so commit cab5dc5d restricted it to happen only for trigger-updatable views. But in the wake of commit 86dc9005, we really don't need it at all. nodeModifyTable.c populates the trigger "OLD" row from the whole-row variable that is generated for the view, and then it computes the "NEW" row using that old row and the UPDATE targetlist. So there is no need for the UPDATE tlist to have dummy entries, any more than it needs them for regular tables or other types of views. (The comments for rewriteTargetListIU suggest that we must do this for correct expansion of NEW references in rules, but I now think that that was just lazy comment editing in 2ec993a7. If we didn't need it for rules on views before there were triggers, we don't need it after that.) This essentially propagates 86dc9005's decision that we don't need dummy column updates into the view case. Aside from making the different cases more uniform and hence possibly forestalling future bugs, it ought to save a little bit of rewriter/planner effort. Discussion: https://postgr.es/m/2181213.1619397634@sss.pgh.pa.us
-
Tom Lane authored
For some reason, the "julian" option for extract()/date_part() has never gotten listed in the manual. Also, while Appendix B mentioned in passing that we don't conform to the usual astronomical definition that a Julian date starts at noon UTC, it was kind of vague about what we do instead. Clarify that, and add an example showing how to get the astronomical definition if you want it. It's been like this for ages, so back-patch to all supported branches. Discussion: https://postgr.es/m/1197050.1619123213@sss.pgh.pa.us
-
Peter Eisentraut authored
The verification of permissions doesn't succeed on Cygwin, because the required feature is not implemented for Cygwin at the moment. So skip this part of the test, like MinGW already does.
-
Michael Paquier authored
The tuple routing logic used by a logical replication worker can fire triggers on relations part of a partition tree, but there was no test coverage in this area. The existing script 003_constraints.pl included something, but nothing when a tuple is applied across partitioned tables on a subscriber. Author: Amit Langote Discussion: https://postgr.es/m/OS0PR01MB611383FA0FE92EB9DE21946AFB769@OS0PR01MB6113.jpnprd01.prod.outlook.com
-
Amit Kapila authored
We send the prepare for the concurrently aborted xacts so that later when rollback prepared is decoded and sent, the downstream should be able to rollback such a xact. For 'streaming' case (when we send changes for in-progress transactions), we were sending prepare twice when concurrent abort was detected. Author: Peter Smith Reviewed-by: Amit Kapila Discussion: https://postgr.es/m/f82133c6-6055-b400-7922-97dae9f2b50b@enterprisedb.com
-
Peter Eisentraut authored
This was already unused in the initial commit 257836a7. Apparently, it was used in an earlier proposed patch version.
-
Amit Kapila authored
Author: Peter Smith Discussion: https://postgr.es/m/CAHut+PtvzuYY0zu=dVRK_WVz5WGos1+otZWgEWqjha1ncoSRag@mail.gmail.com
-
- 25 Apr, 2021 2 commits
-
-
Tom Lane authored
This function's behavior for UPDATE on a trigger-updatable view was justified by analogy to what preptlist.c used to do for UPDATE on regular tables. Since preptlist.c hasn't done that since 86dc9005, that argument is no longer sensible, let alone convincing. I think we do still need it to act that way, so update the comment to explain why.
-
Noah Misch authored
-
- 24 Apr, 2021 5 commits
-
-
Andrew Dunstan authored
This will install amcheck in the database if not present. The default schema is for the extension is pg_catalog, but this can be overridden by providing a value for the option. Mark Dilger, slightly editorialized by me. (rather divergent) Discussion: https://postgr.es/m/bdc0f7c2-09e3-ee57-8471-569dfb509234@dunslane.net
-
Andrew Dunstan authored
As well as 'devel' version_stamp.pl provides for 'alphaN' 'betaN' and 'rcN', so teach PostgresVersion about those. Also stash the version string instead of trying to reconstruct it during stringification. Discussion: https://postgr.es/m/YIHlw5nSgAHs4dK1@paquier.xyz
-
Michael Paquier authored
1375422c has refactored this area of the executor code, and some comments went out-of-sync. Author: Yukun Wang Reviewed-by: Amul Sul Discussion: https://postgr.es/m/OS0PR01MB60033394FCAEF79B98F078F5B4459@OS0PR01MB6003.jpnprd01.prod.outlook.com
-
Michael Paquier authored
Author: Justin Pryzby Discussion: https://postgr.es/m/20210423184338.GL7256@telsasoft.com
-
Michael Paquier authored
6f6f284c has introduced a specific macro to make printf()-ing of LSNs easier. This takes care of what looks like the remaining code paths that did not get the call. Author: Michael Paquier Reviewed-by: Kyotaro Horiguchi, Tom Lane Discussion: https://postgr.es/m/YIJS9x6K8ruizN7j@paquier.xyz
-
- 23 Apr, 2021 13 commits
-
-
Peter Geoghegan authored
This isn't strictly necessary, but in theory it might matter if in the future the width of the nbtree special area changes -- its total size might not be an even number of MAXALIGN() quantums, even with padding. PageInit() MAXALIGN()s all special area offsets, but amcheck uses the offset to perform initial basic validation of line pointers, so we don't rely on the offset from the page header. The real reason to do this is to set a good example for new code that adds amcheck coverage for other index AMs. Reported-By: Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com> Discussion: https://postgr.es/m/CALj2ACUMqTR9nErh99FbOBmzCXE9=gXNqhBiwYOhejJJS1LXqQ@mail.gmail.com
-
Peter Eisentraut authored
Instead, put them in via a format placeholder. This reduces the number of distinct translatable messages and also reduces the chances of typos during translation. We already did this for the system call arguments in a number of cases, so this is just the same thing taken a bit further. Discussion: https://www.postgresql.org/message-id/flat/92d6f545-5102-65d8-3c87-489f71ea0a37%40enterprisedb.com
-
Peter Eisentraut authored
Some code thought this was unsigned, but it's signed int.
-
Alexander Korotkov authored
These functions shouldn't receive null arguments: multirange_constructor0() doesn't have any arguments while multirange_constructor2() has a single array argument, which is never null. But mark them strict anyway for the sake of uniformity. Also, make checks for null arguments use elog() instead of ereport() as these errors should normally be never thrown. And adjust corresponding comments. Catversion is bumped. Reported-by: Peter Eisentraut Discussion: https://postgr.es/m/0f783a96-8d67-9e71-996b-f34a7352eeef%40enterprisedb.com
-
Fujii Masao authored
Commit bbe0a81d introduced "INCLUDING COMPRESSION" option in CREATE TABLE command, but previously TableLikeOption in gram.y and parsenodes.h didn't classify this new option in alphabetical order with the rest. Author: Fujii Masao Reviewed-by: Michael Paquier Discussion: https://postgr.es/m/YHerAixOhfR1ryXa@paquier.xyz
-
Magnus Hagander authored
While at it, also document that toplevel is always true if pg_stat_statements.track is set to top. Author: Julien Rouhaud Reported-By: Fujii Masao Discussion: https://postgr.es/m/a878d5ea-64a7-485e-5d2f-177618ebc52d@oss.nttdata.com
-
Peter Eisentraut authored
This was already mostly done, but some error messages were printed the long way.
-
Peter Eisentraut authored
Author: Justin Pryzby <pryzby@telsasoft.com>
-
Fujii Masao authored
Previously it was documented that if using "-X none" option there was no guarantee that all required WAL files were archived at the end of pg_basebackup when taking a backup from the standby. But this limitation was removed by commit 52f8a59d. Now, even when taking a backup from the standby, pg_basebackup can wait for all required WAL files to be archived. Therefore this commit removes such obsolete description from the docs. Also this commit adds new description about the limitation when taking a backup from the standby, into the docs. The limitation is that pg_basebackup cannot force the standbfy to switch to a new WAL file at the end of backup, which may cause pg_basebackup to wait a long time for the last required WAL file to be switched and archived, especially when write activity on the primary is low. Back-patch to v10 where the issue was introduced. Reported-by: Kyotaro Horiguchi Author: Kyotaro Horiguchi, Fujii Masao Reviewed-by: Kyotaro Horiguchi, Fujii Masao Discussion: https://postgr.es/m/20210420.133235.1342729068750553399.horikyota.ntt@gmail.com
-
Peter Eisentraut authored
-
Michael Paquier authored
Oversight in 2a0faed9. Author: Hou Zhijie Discussion: https://postgr.es/m/OS0PR01MB5716405E2464D85E6DB6DC0794469@OS0PR01MB5716.jpnprd01.prod.outlook.com
-
Michael Paquier authored
%lld with (long long), or %llu with (unsigned long long) are more adapted. This is similar to 32860656. Author: Kyotaro Horiguchi Discussion: https://postgr.es/m/20210421.200000.1462448394029407895.horikyota.ntt@gmail.com
-
Etsuro Fujita authored
This is cleanup for commit 27e1f145: * ExecAppendAsyncEventWait(), which was modified a bit further by commit a8af856d, duplicated the same nevents calculation. Simplify the code a little bit to avoid the duplication. Update comments there. * Add an assertion to ExecAppendAsyncRequest(). * Update a comment about merging the async_capable options from input relations in merge_fdw_options(), per complaint from Kyotaro Horiguchi. * Add a comment for fetch_more_data_begin(). Author: Etsuro Fujita Discussion: https://postgr.es/m/CAPmGK1637W30Wx3MnrReewhafn6F_0J76mrJGoFXFnpPq4QfvA%40mail.gmail.com
-
- 22 Apr, 2021 10 commits
-
-
Tom Lane authored
Adopt a more consistent policy about what slot-type-specific getsysattr functions should do when system attributes are not available. To wit, they should all throw the same user-oriented error, rather than variously crashing or emitting developer-oriented messages. This closes a identifiable problem in commits a71cfc56b and 3fb93103a (in v13 and v12), so back-patch into those branches, along with a test case to try to ensure we don't break it again. It is not known that any of the former crash cases are reachable in HEAD, but this seems like a good safety improvement in any case. Discussion: https://postgr.es/m/141051591267657@mail.yandex.ru
-
Peter Eisentraut authored
-
Alvaro Herrera authored
Have interested callers of find_inheritance_children set the detached_exist value to false prior to calling it, so that that routine only has to set it true in the rare cases where it is necessary. Don't touch it otherwise. Per buildfarm member thorntail (which reported a UBSan failure here).
-
Bruce Momjian authored
This was discussed in commit 9081bddb. Reported-by: Peter Eisentraut Discussion: https://postgr.es/m/flat/87o8pco34z.fsf@wibble.ilmari.org
-
Andrew Dunstan authored
per gripe from Alvaro Herrera.
-
Alvaro Herrera authored
During queries coming from ri_triggers.c, we need to omit partitions that are marked pending detach -- otherwise, the RI query is tricked into allowing a row into the referencing table whose corresponding row is in the detached partition. Which is bogus: once the detach operation completes, the row becomes an orphan. However, the code was not doing that in repeatable-read transactions, because relcache kept a copy of the partition descriptor that included the partition, and used it in the RI query. This commit changes the partdesc cache code to only keep descriptors that aren't dependent on a snapshot (namely: those where no detached partition exist, and those where detached partitions are included). When a partdesc-without- detached-partitions is requested, we create one afresh each time; also, those partdescs are stored in PortalContext instead of CacheMemoryContext. find_inheritance_children gets a new output *detached_exist boolean, which indicates whether any partition marked pending-detach is found. Its "include_detached" input flag is changed to "omit_detached", because that name captures desired the semantics more naturally. CreatePartitionDirectory() and RelationGetPartitionDesc() arguments are identically renamed. This was noticed because a buildfarm member that runs with relcache clobbering, which would not keep the improperly cached partdesc, broke one test, which led us to realize that the expected output of that test was bogus. This commit also corrects that expected output. Author: Amit Langote <amitlangote09@gmail.com> Author: Álvaro Herrera <alvherre@alvh.no-ip.org> Discussion: https://postgr.es/m/3269784.1617215412@sss.pgh.pa.us
-
Tom Lane authored
Back-patch to v13; the table layout in older branches is unfriendly to adding such details. Laurenz Albe Discussion: https://postgr.es/m/161881920775.685.12293798764864559341@wrigleys.postgresql.org
-
Andrew Dunstan authored
A new PostgresVersion object type is created and this is used in PostgresNode using the output of `pg_config --version` and the result stored in the PostgresNode object. This object can be compared to other PostgresVersion objects, or to a number or string. PostgresNode is currently believed to be compatible with versions down to release 12, so PostgresNode will issue a warning if used with a version prior to that. No attempt has been made to deal with incompatibilities in older versions - that remains work to be undertaken in a subsequent development cycle. Based on code from Mark Dilger and Jehan-Guillaume de Rorthais. Discussion: https://postgr.es/m/a80421c0-3d7e-def1-bcfe-24777f15e344@dunslane.net
-
Michael Paquier authored
Creating a trigger on a relation to which an apply operation is triggered would cause a relation leak once the change gets committed, as the executor would miss that the relation needs to be closed beforehand. This issue got introduced with the refactoring done in 1375422c, where it becomes necessary to track relations within es_opened_result_relations to make sure that they are closed. We have discussed using ExecInitResultRelation() coupled with ExecCloseResultRelations() for the relations in need of tracking by the apply operations in the subscribers, which would simplify greatly the opening and closing of indexes, but this requires a larger rework and reorganization of the worker code, particularly for the tuple routing part. And that's not really welcome post feature freeze. So, for now, settle down to the same solution as TRUNCATE which is to fill in es_opened_result_relations with the relation opened, to make sure that ExecGetTriggerResultRel() finds them and that they get closed. The code is lightly refactored so as a relation is not registered three times for each DML code path, making the whole a bit easier to follow. Reported-by: Tang Haiying, Shi Yu, Hou Zhijie Author: Amit Langote, Masahiko Sawada, Hou Zhijie Reviewed-by: Amit Kapila, Michael Paquier Discussion: https://postgr.es/m/OS0PR01MB611383FA0FE92EB9DE21946AFB769@OS0PR01MB6113.jpnprd01.prod.outlook.com
-
Michael Paquier authored
parallel_leader_participation got introduced in e5253fdc, where it was listed under RESOURCES_ASYNCHRONOUS in guc.c, but the documentation did not reflect that and listed it with the other planner-related options. This commit fixes this inconsistency as the parameter is intended to be an asynchronous one. While on it, reorganize a bit the section dedicated to asynchronous parameters, backend_flush_after being moved first to do better in terms of alphabetical order of the options listed. Reported-by: Yanliang Lei Author: Bharath Rupireddy Discussion: https://postgr.es/m/16972-42d4b0c15aa1d5f5@postgresql.org
-
- 21 Apr, 2021 2 commits
-
-
Alvaro Herrera authored
Per observation from Tom Lane. Discussion: https://postgr.es/m/1901125.1617904665@sss.pgh.pa.us
-
Alvaro Herrera authored
On ALTER TABLE .. DETACH CONCURRENTLY, we add a new table constraint that duplicates the partition constraint. But if the partition already has another constraint that implies that one, then that's unnecessary. We were already avoiding the addition of a duplicate constraint if there was an exact 'equal' match -- this just improves the quality of the check. Author: Justin Pryzby <pryzby@telsasoft.com> Reviewed-by: Álvaro Herrera <alvherre@alvh.no-ip.org> Discussion: https://postgr.es/m/20210410184226.GY6592@telsasoft.com
-