https://github.com/postgres/postgres

sort by:
Revision Author Date Message Commit Date
2a40d04 Stamp 15rc2. 03 October 2022, 21:03:12 UTC
595580a Fix psql's behavior with \g for a multiple-command string. The pre-v15 behavior was to discard all but the last result, but with the new behavior of printing all results by default, we will send each such result to the \g file. However, we're still opening and closing the \g file for each result, so you lose all but the last result anyway. Move the output-file state up to ExecQueryAndProcessResults so that we open/close the \g file only once per command string. To support this without changing other behavior, we must adjust PrintQueryResult to have separate FILE * arguments for query and status output (since status output has never gone to the \g file). That in turn makes it a good idea to push the responsibility for fflush'ing output down to PrintQueryTuples and PrintQueryStatus. Also fix an infinite loop if COPY IN/OUT is attempted in \watch. We used to reject that, but that error exit path got broken somewhere along the line in v15. There seems no real reason to reject it anyway as the code now stands, so just remove the error exit and make sure that COPY OUT data goes to the right place. Also remove PrintQueryResult's unused is_watch parameter, and make some other cosmetic cleanups (adjust obsolete comments, break some overly-long lines). Daniel Vérité and Tom Lane Discussion: https://postgr.es/m/4333844c-2244-4d6e-a49a-1d483fbe304f@manitou-mail.org 03 October 2022, 19:07:10 UTC
b1c73e1 Doc: update v15 release notes. 03 October 2022, 15:06:33 UTC
443df6e Revert "Optimize order of GROUP BY keys". This reverts commit db0d67db2401eb6238ccc04c6407a4fd4f985832 and several follow-on fixes. The idea of making a cost-based choice of the order of the sorting columns is not fundamentally unsound, but it requires cost information and data statistics that we don't really have. For example, relying on procost to distinguish the relative costs of different sort comparators is pretty pointless so long as most such comparator functions are labeled with cost 1.0. Moreover, estimating the number of comparisons done by Quicksort requires more than just an estimate of the number of distinct values in the input: you also need some idea of the sizes of the larger groups, if you want an estimate that's good to better than a factor of three or so. That's data that's often unknown or not very reliable. Worse, to arrive at estimates of the number of calls made to the lower-order-column comparison functions, the code needs to make estimates of the numbers of distinct values of multiple columns, which are necessarily even less trustworthy than per-column stats. Even if all the inputs are perfectly reliable, the cost algorithm as-implemented cannot offer useful information about how to order sorting columns beyond the point at which the average group size is estimated to drop to 1. Close inspection of the code added by db0d67db2 shows that there are also multiple small bugs. These could have been fixed, but there's not much point if we don't trust the estimates to be accurate in-principle. Finally, the changes in cost_sort's behavior made for very large changes (often a factor of 2 or so) in the cost estimates for all sorting operations, not only those for multi-column GROUP BY. That naturally changes plan choices in many situations, and there's precious little evidence to show that the changes are for the better. Given the above doubts about whether the new estimates are really trustworthy, it's hard to summon much confidence that these changes are better on the average. Since we're hard up against the release deadline for v15, let's revert these changes for now. We can always try again later. Note: in v15, I left T_PathKeyInfo in place in nodes.h even though it's unreferenced. Removing it would be an ABI break, and it seems a bit late in the release cycle for that. Discussion: https://postgr.es/m/TYAPR01MB586665EB5FB2C3807E893941F5579@TYAPR01MB5866.jpnprd01.prod.outlook.com 03 October 2022, 14:56:16 UTC
b507a7a ci: macos: Reduce test concurrency Test performance regresses noticably when using all cores. This is more pronounced with meson than with autoconf, presumably because meson will schedule the "full number" of tests more consistently. 8 seems to work OK. Discussion: https://postgr.es/m/20220927040208.l3shfcidovpzqxfh@awork3.anarazel.de Backpatch: 15-, where CI was introduced 01 October 2022, 23:56:15 UTC
64b431d doc: Fix some grammar and typos This fixes some areas related to logical replication and custom RMGRs. Author: Ekaterina Kiryanova Discussion: https://postgr.es/m/fa4773f1-1396-384a-bcd7-85b5e013f399@postgrespro.ru Backpatch-through: 15 01 October 2022, 06:28:11 UTC
2267085 Avoid improbable PANIC during heap_update, redux. Commit 34f581c39 intended to ensure that RelationGetBufferForTuple would acquire a visibility-map page pin in case the otherBuffer's all-visible bit had become set since we last had lock on that page. But I missed a case: when we're extending the relation, VM concerns were dealt with only in the relatively-less-likely case that we fail to conditionally lock the otherBuffer. I think I'd believed that we couldn't need to worry about it if the conditional lock succeeds, which is true for the target buffer; but the otherBuffer was unlocked for awhile so its bit might be set anyway. So we need to do the GetVisibilityMapPins dance, and then also recheck the page's free space, in both cases. Per report from Jaime Casanova. Back-patch to v12 as the previous patch was (although there's still no evidence that the bug is reachable pre-v14). Discussion: https://postgr.es/m/E1lWLjP-00006Y-Ml@gemulon.postgresql.org 30 September 2022, 23:36:46 UTC
d8e6ae9 Fix tab-completion after commit 790bf615ddba I (Álvaro) broke tab-completion for GRANT .. ALL TABLES IN SCHEMA while removing ALL from the publication syntax for schemas in the aforementioned commit. I also missed to update a bunch of tab-completion rules for ALTER/CREATE PUBLICATION that match each individual piece of ALL TABLES IN SCHEMA. Repair those bugs. While fixing up that commit, update a couple of outdated comments related to the same change. Backpatch to 15. Author: Shi yu <shiy.fnst@fujitsu.com> Reviewed-by: Peter Smith <smithpb2250@gmail.com> Discussion: https://postgr.es/m/OSZPR01MB6310FCE8609185A56344EED2FD559@OSZPR01MB6310.jpnprd01.prod.outlook.com 30 September 2022, 10:53:31 UTC
a613474 doc: Fix PQsslAttribute docs for compression The compression parameter to PQsslAttribute has never returned the compression method used, it has always returned "on" or "off since it was added in commit 91fa7b4719ac. Backpatch through v10. Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://postgr.es/m/B9EC60EC-F665-47E8-A221-398C76E382C9@yesql.se Backpatch-through: v10 30 September 2022, 10:03:48 UTC
cae4688 Fix bogus behavior of PQsslAttribute(conn, "library"). Commit ebc8b7d44 intended to change the behavior of PQsslAttribute(NULL, "library"), but accidentally also changed what happens with a non-NULL conn pointer. Undo that so that only the intended behavior change happens. Clarify some associated documentation. Per bug #17625 from Heath Lord. Back-patch to v15. Discussion: https://postgr.es/m/17625-fc47c78b7d71b534@postgresql.org 29 September 2022, 21:28:09 UTC
d460faf Update comment in ExecInsert() regarding batch insertion. Remove the stale text that is a leftover from an earlier version of the patch to add support for batch insertion, and adjust the wording in the remaining text. Back-patch to v14 where batch insertion came in. Review and wording adjustment by Tom Lane. Discussion: https://postgr.es/m/CAPmGK14goatHPHQv2Aeu_UTKqZ%2BBO%2BP%2Bzd3HKv5D%2BdyyfWKDSw%40mail.gmail.com 29 September 2022, 07:55:01 UTC
f7ae8a2 Restrict Datum sort optimization to byval types only 91e9e89dc modified nodeSort.c so that it used datum sorts when the targetlist of the outer node contained only a single column. That commit failed to recognise that the Datum returned by tuplesort_getdatum() must be pfree'd when the type is a byref type. Ronan Dunklau did originally propose the patch with that restriction, but that, probably through my own fault, got lost during further development work. Due to the timing of this report (PG15 RC1 is almost out the door), let's just restrict the datum sort optimization to apply for byval types only. We might want to look harder into making this work for byref types in PG16. Reported-by: Önder Kalacı Diagnosis-by: Tom Lane Discussion: https://postgr.es/m/CACawEhVxe0ufR26UcqtU7GYGRuubq3p6ZWPGXL4cxy_uexpAAQ@mail.gmail.com Backpatch-through: 15, where 91e9e89dc was introduced. 28 September 2022, 22:43:40 UTC
517fab6 doc: clarify internal behavior of RECURSIVE CTE queries Reported-by: Tom Lane Discussion: https://postgr.es/m/3976627.1662651004@sss.pgh.pa.us Backpatch-through: 10 28 September 2022, 17:14:38 UTC
9bb5412 revert "warn of SECURITY DEFINER schemas for non-sql_body funcs" doc revert of commit 1703726488. Change was applied to irrelevant branches, and was not detailed enough to be helpful in relevant branches. Reported-by: Peter Eisentraut, Noah Misch Discussion: https://postgr.es/m/a2dc9de4-24fc-3222-87d3-0def8057d7d8@enterprisedb.com Backpatch-through: 10 28 September 2022, 17:05:20 UTC
1eeac95 Change some errdetail() to errdetail_internal() This prevents marking the argument string for translation for gettext, and it also prevents the given string (which is already translated) from being translated at runtime. Also, mark the strings used as arguments to check_rolespec_name for translation. Backpatch all the way back as appropriate. None of this is caught by any tests (necessarily so), so I verified it manually. 28 September 2022, 15:14:53 UTC
a60b113 Remove publicationcmds.c's expr_allowed_in_node as a function Its API is quite strange, and since there's only one caller, there's no reason for it to be a separate function in the first place. Inline it instead. Discussion: https://postgr.es/m/20220927124249.4zdzzlz6had7k3x2@alvherre.pgsql 28 September 2022, 11:47:25 UTC
f5441b9 Improve some publication-related error messages While at it, remove an unused queryString parameter from CheckPubRelationColumnList() and make other minor stylistic changes. Backpatch to 15. Reported by Kyotaro Horiguchi <horikyota.ntt@gmail.com> Co-authored-by: Hou zj <houzj.fnst@fujitsu.com> Discussion: https://postgr.es/m/20220926.160426.454497059203258582.horikyota.ntt@gmail.com 27 September 2022, 12:11:31 UTC
72abf03 Fix pg_stat_statements for MERGE We weren't jumbling the merge action list, so wildly different commands would be considered to use the same query ID. Add that, mention it in the docs, and some test lines. Backpatch to 15. Author: Tatsu <bt22nakamorit@oss.nttdata.com> Reviewed-by: Julien Rouhaud <rjuju123@gmail.com> Discussion: https://postgr.es/m/d87e391694db75a038abc3b2597828e8@oss.nttdata.com 27 September 2022, 08:44:42 UTC
d1f95fa ci: Add hint about downloadable logs to README I (Andres) chose to backpatch this to 15, as it seems better to keep the README the same. Author: James Coleman <jtc331@gmail.com> Discussion: https://postgr.es/m/CAAaqYe_7BXDjpk0Ks_eqf1r6LZpC_rfB7kjhb_T3+eC4t6yiGQ@mail.gmail.com Backpatch: 15-, where CI came in 27 September 2022, 03:03:37 UTC
bb76510 Doc: last minute adjustment to the release notes The change made in 9d9c02ccd also affects the dense_rank() function. Mention this in the release notes. Author: Jonathan S. Katz Discussion: https://postgr.es/m/5c6d3f50-e9b5-f62d-d58a-7b22eb91d8b8@postgresql.org 26 September 2022, 21:57:07 UTC
6abbd21 Stamp 15rc1. 26 September 2022, 20:36:49 UTC
780add2 Doc: more tweaking of v15 release notes. Per suggestions from Justin Pryzby. Discussion: https://postgr.es/m/20220925215009.GC21938@telsasoft.com 26 September 2022, 18:32:51 UTC
796aa20 Doc: further adjust notes about pg_upgrade_output.d. I'd misunderstood how it worked in 5f1048881. Discussion: https://postgr.es/m/20220925215009.GC21938@telsasoft.com 26 September 2022, 18:19:21 UTC
0570eba Translation updates Source-Git-URL: https://git.postgresql.org/git/pgtranslation/messages.git Source-Git-Hash: 0a336c1e07ac371cf445a0cecac6b27720da228c 26 September 2022, 11:16:06 UTC
5483649 Update list of acknowledgments in release notes current through 15113bfb467a84688744b57b74a14550878d0224 26 September 2022, 10:57:12 UTC
15113bf Doc: Remove the use of a duplicate word. This has been removed in HEAD by commit a234177906, so doing just backpatch to 15 where it was introduced in commit 860ea46ba7. Author: Zhang Mingli Discussion: https://postgr.es/m/OS0PR01MB57162559C01FE2848C12E8F7944D9@OS0PR01MB5716.jpnprd01.prod.outlook.com 26 September 2022, 03:56:47 UTC
c82766c Fix tupdesc lifespan bug with AfterTriggersTableData.storeslot. Commit 25936fd46 adjusted things so that the "storeslot" we use for remapping trigger tuples would have adequate lifespan, but it neglected to consider the lifespan of the tuple descriptor that the slot depends on. It turns out that in at least some cases, the tupdesc we are passing is a refcounted tupdesc, and the refcount for the slot's reference can get assigned to a resource owner having different lifespan than the slot does. That leads to an error like "tupdesc reference 0x7fdef236a1b8 is not owned by resource owner SubTransaction". Worse, because of a second oversight in the same commit, we'd try to free the same tupdesc refcount again while cleaning up after that error, leading to recursive errors and an "ERRORDATA_STACK_SIZE exceeded" PANIC. To fix the initial problem, let's just make a non-refcounted copy of the tupdesc we're supposed to use. That seems likely to guard against additional problems, since there's no strong reason for this code to assume that what it's given is a refcounted tupdesc; in which case there's an independent hazard of the tupdesc having shorter lifespan than the slot does. (I didn't bother trying to free said copy, since it should go away anyway when the (sub) transaction context is cleaned up.) The other issue can be fixed by making the code added to AfterTriggerFreeQuery work like the rest of that function, ie be sure that it doesn't try to free the same slot twice in the event of recursive error cleanup. While here, also clean up minor stylistic issues in the test case added by 25936fd46: don't use "create or replace function", as any name collision within the tests is likely to have ill effects that that won't mask; and don't use function names as generic as trigger_function1, especially if you're not going to drop them at the end of the test stanza. Per bug #17607 from Thomas Mc Kay. Back-patch to v12, as the previous fix was. Discussion: https://postgr.es/m/17607-bd8ccc81226f7f80@postgresql.org 25 September 2022, 21:10:58 UTC
7a84c35 Avoid loss of code coverage with unlogged-index test cases. Commit 4fb5c794e intended to add coverage of some ambuildempty methods that were not getting reached, without removing any test coverage. However, by changing a temp table to unlogged it managed to negate the intent of 4c51a2d1e, which means that we didn't have reliable test coverage of ginvacuum.c anymore. As things stand, much of that file might or might not get reached depending on timing, which seems pretty undesirable. Although this is only clearly broken for the GIN test, it seems best to revert 4fb5c794e altogether and instead add bespoke test cases covering unlogged indexes for these four AMs. We don't need to do very much with them, so the extra tests are cheap. (Note that btree, hash, and bloom already have similar test cases, so they need no additional work.) We can also undo dec8ad367. Since the testing deficiency that that hacked around was later fixed by 2f2e24d90, let's intentionally leave an unlogged table behind to improve test coverage in the modules that use the regression database for other test purposes. (The case I used also leaves an unlogged sequence behind.) Per report from Alex Kozhemyakin. Back-patch to v15 where the faulty test came in. Discussion: https://postgr.es/m/b00c8ee096ee46cd25c183125562a1a7@postgrespro.ru 25 September 2022, 17:10:17 UTC
7a41e34 Add missing source files to pg_waldump/nls.mk 25 September 2022, 15:48:03 UTC
517484b Message style improvements 24 September 2022, 22:38:35 UTC
8d98556 Improve terminology Use "prepared transaction" instead of "two-phrase transaction". This is in line with c5d67881d343a507269bde124a49df19e0296157. 24 September 2022, 01:16:08 UTC
2b14b5b Doc: make an editorial pass over the v15 release notes. Rearrange, reword, clarify, fix markup, etc etc. Also include commit bd8ac900d. 23 September 2022, 22:22:33 UTC
cea5aa9 Doc: minor cleanups. Improve a couple of things I noticed while working on v15 release notes. 23 September 2022, 22:20:14 UTC
43e496e pgstat: Fix transactional stats dropping for indexes Because index creation does not go through heap_create_with_catalog() we didn't call pgstat_create_relation(), leading to index stats of a newly created realtion not getting dropped during rollback. To fix, move the pgstat_create_relation() to heap_create(), which indexes do use. Similarly, because dropping an index does not go through heap_drop_with_catalog(), we didn't drop index stats when the transaction dropping an index committed. Here there's no convenient common path for indexes and relations, so index_drop() now calls pgstat_drop_relation(). Add tests for transactional index stats handling. Author: "Drouvot, Bertrand" <bdrouvot@amazon.com> Reviewed-by: Andres Freund <andres@anarazel.de> Reviewed-by: Kyotaro Horiguchi <horikyota.ntt@gmail.com> Discussion: https://postgr.es/m/51bbf286-2b4a-8998-bd12-eaae4b765d99@amazon.com Backpatch: 15-, like 8b1dccd37c71, which introduced the bug 23 September 2022, 20:13:50 UTC
e956325 Doc: update v15 release notes through today. Account for commits since 2022-06-11. 23 September 2022, 17:59:55 UTC
bd8ac90 Remove PQsendQuery support in pipeline mode The extended query protocol implementation I added in commit acb7e4eb6b1c has bugs when used in pipeline mode. Rather than spend more time trying to fix it, remove that code and make the function rely on simple query protocol only, meaning it can no longer be used in pipeline mode. Users can easily change their applications to use PQsendQueryParams instead. We leave PQsendQuery in place for Postgres 14, just in case somebody is using it and has not hit the mentioned bugs; but we should recommend that it not be used. Backpatch to 15. Per bug report from Gabriele Varrazzo. Discussion: https://postgr.es/m/CA+mi_8ZGSQNmW6-mk_iSR4JZB_LJ4ww3suOF+1vGNs3MrLsv4g@mail.gmail.com 23 September 2022, 16:21:22 UTC
27e0441 Stop using PQsendQuery in libpq_pipeline The "emulation" I wrote for PQsendQuery in pipeline mode to use extended query protocol, in commit acb7e4eb6b1c, is problematic. Due to numerous bugs we'll soon remove it. As a first step and for all branches back to 14, stop using PQsendQuery in libpq_pipeline. Also remove a few test lines that will no longer be relevant. Backpatch to 14. Discussion: https://postgr.es/m/CA+mi_8ZGSQNmW6-mk_iSR4JZB_LJ4ww3suOF+1vGNs3MrLsv4g@mail.gmail.com 23 September 2022, 16:11:48 UTC
a2ab0ad Doc: add list of major features to the v15 release notes. Jonathan Katz (word-smithed a bit by me) Discussion: https://postgr.es/m/a6661e2c-72e0-b4bd-9301-9225bdddda4c@postgresql.org 23 September 2022, 15:24:12 UTC
b725675 Allow publications with schema and table of the same schema. We previously thought that allowing such cases can confuse users when they specify DROP TABLES IN SCHEMA but that doesn't seem to be the case based on discussion. This helps to uplift the restriction during ALTER TABLE ... SET SCHEMA which used to ensure that we couldn't end up with a publication having both a schema and the same schema's table. To allow this, we need to forbid having any schema on a publication if column lists on a table are specified (and vice versa). This is because otherwise we still need a restriction during ALTER TABLE ... SET SCHEMA to forbid cases where it could lead to a publication having both a schema and the same schema's table with column list. Based on suggestions by Peter Eisentraut. Author: Hou Zhijie and Vignesh C Reviewed-By: Peter Smith, Amit Kapila Backpatch-through: 15, where it was introduced Discussion: https://postgr.es/m/2729c9e2-9aac-8cda-f2f4-34f2bcc18f4e@enterprisedb.com 23 September 2022, 02:38:24 UTC
dd6070b Fix race condition where heap_delete() fails to pin VM page. Similar to 5f12bc94dc, the code must re-check PageIsAllVisible() after buffer lock is re-acquired. Backpatching to the same version, 12. Discussion: https://postgr.es/m/CAEP4nAw9jYQDKd_5Y+-s2E4YiUJq1vqiikFjYGpLShtp-K3gag@mail.gmail.com Reported-by: Robins Tharakan Reviewed-by: Robins Tharakan Backpatch-through: 12 22 September 2022, 18:04:36 UTC
f256236 Remove ALL keyword from TABLES IN SCHEMA for publication This may be a bit too subtle, but removing that word from there makes this clause no longer a perfect parallel of the GRANT variant "ALL TABLES IN SCHEMA": indeed, for publications what we record is the schema itself, not the tables therein, which means that any tables added to the schema in the future are also published. This is completely different to what GRANT does, which is affect only the tables that exist when the command is executed. There isn't resounding support for this change, but there are a few positive votes and no opposition. Because the time to 15 RC1 is very short, let's get this out now. Backpatch to 15. Discussion: https://postgr.es/m/2729c9e2-9aac-8cda-f2f4-34f2bcc18f4e 22 September 2022, 17:02:25 UTC
5f56933 Restore archive_command documentation Commit 5ef1eefd76f404ddc59b885d50340e602b70f05f, which added archive_library, purged most mentions of archive_command from the documentation. This is inappropriate, since archive_command is still a feature in use and users will want to see information about it. This restores all the removed mentions and rephrases things so that archive_command and archive_library are presented as alternatives of each other. Reviewed-by: Nathan Bossart <nathandbossart@gmail.com> Discussion: https://www.postgresql.org/message-id/9366d634-a917-85a9-4991-b2a4859edaf9@enterprisedb.com 22 September 2022, 11:32:23 UTC
ade925e Use min/max bounds defined by Zstd for compression level The bounds hardcoded in compression.c since ffd5365 (minimum at 1 and maximum at 22) do not match the reality of what zstd is able to handle, these values being available via ZSTD_maxCLevel() and ZSTD_minCLevel() at run-time. The maximum of 22 is actually correct in recent versions, but the minimum was not as the library can go down to -131720 by design. This commit changes the code to use the run-time values in the code instead of some hardcoded ones. Zstd seems to assume that these bounds could change in the future, and Postgres will be able to adapt automatically to such changes thanks to what's being done in this commit. Reported-by: Justin Prysby Discussion: https://postgr.es/m/20220922033716.GL31833@telsasoft.com Backpatch-through: 15 22 September 2022, 11:03:30 UTC
901ef14 Fix thinko in comment. This comment has been wrong since its introduction in commit 0d5f05cde; backpatch to v12 where that came in. Discussion: https://postgr.es/m/CAPmGK14VGf-xQjGQN4o1QyAbXAaxugU5%3DqfcmTDh1iufUDnV_w%40mail.gmail.com 22 September 2022, 06:55:01 UTC
848c323 Clear ps display of startup process at the end of recovery If the ps display is not cleared at this point, the process could continue displaying "recovering NNN" even if handling end-of-recovery steps. df9274a has tackled that by providing some information with the end-of-recovery checkpoint but 7ff23c6 has nullified the effect of the first commit. Per a suggestion from Justin, just clear the ps display when we are done with recovery, so as no incorrect information is displayed. This may get extended in the future, but for now restore the pre-7ff23c6 behavior. Author: Justin Prysby Discussion: https://postgr.es/m/20220913223954.GU31833@telsasoft.com Backpatch-through: 15 22 September 2022, 05:25:12 UTC
4230279 docs: Fix snapshot name in SET TRANSACTION docs. Commit 6c2003f8a1 changed the snapshot names mentioned in SET TRANSACTION docs, however, there was one place that the commit missed updating the name. Back-patch to all supported versions. Author: Japin Li Reviewed-by: Fujii Masao Discussion: https://postgr.es/m/MEYP282MB1669BD4280044501165F8B07B64F9@MEYP282MB1669.AUSP282.PROD.OUTLOOK.COM 22 September 2022, 03:55:18 UTC
f80919d psql: Improve tab-completion for MERGE. Commit 7103ebb7aa added the tab-completion for MERGE accidentally in the middle of that for LOCK TABLE. This commit fixes this issue. This also adds some tab-completion for MERGE. Back-patch to v15 where MERGE was introduced. Author: Kotaro Kawamoto, Fujii Masao Reviewed-by: Shinya Kato, Álvaro Herrera Discussion: https://postgr.es/m/9f1ad2a87a58cd5e7d64f3993130958d@oss.nttdata.com 22 September 2022, 00:26:08 UTC
0c40044 ci: windows: set error mode to not include SEM_NOGPFAULTERRORBOX Cirrus defaults to SetErrorMode(SEM_NOGPFAULTERRORBOX | ...). That prevents crash reporting from working unless binaries do SetErrorMode() themselves. Furthermore, it appears that either python or, more likely, the C runtime has a bug where SEM_NOGPFAULTERRORBOX can very occasionally *trigger* a crash on process exit - which is hard to debug, given that it explicitly prevents crash dumps from working... Discussion: https://postgr.es/m/20220909235836.lz3igxtkcjb5w7zb%40awork3.anarazel.de Backpatch: 15-, where CI was added 22 September 2022, 00:16:51 UTC
08ddb3c ci: Increase requested memory size. CI builds recently started failing with: "Memory size for 4.0 vCPU instance should be between 3840MiB and 26624MiB, while 2048MiB is requested." Ok then, let's ask for 4G instead of 2G. This may be due to a change in the type of instance used to work around an outage, per: https://twitter.com/cirrus_labs/status/1572657320093712384 21 September 2022, 23:55:11 UTC
865b52a Improve ICU option handling in CREATE DATABASE We check that the ICU locale is only specified if the ICU locale provider is selected. But we did that too early. We need to wait until we load the settings of the template database, since that could also set what the locale provider is. Reported-by: Marina Polyakova <m.polyakova@postgrespro.ru> Discussion: https://www.postgresql.org/message-id/9ba4cd1ea6ed6b7b15c0ff15e6f540cd@postgrespro.ru 21 September 2022, 14:41:27 UTC
ab7032b Tighten pg_get_object_address argument checking For publication schemas (OBJECT_PUBLICATION_NAMESPACE) and user mappings (OBJECT_USER_MAPPING), pg_get_object_address() checked the array length of the second argument, but not of the first argument. If the first argument was too long, it would just silently ignore everything but the first argument. Fix that by checking the length of the first argument as well. Reviewed-by: Amit Kapila <amit.kapila16@gmail.com> Discussion: https://www.postgresql.org/message-id/flat/caaef70b-a874-1088-92ef-5ac38269c33b%40enterprisedb.com 21 September 2022, 13:42:22 UTC
1d39552 Improve some GUC description strings It is not our usual style to use "we" in messages. Also, remove some noise words. Backpatch to 15. Noted by Kyotaro Horiguchi. Discussion: https://postgr.es/m/20220914.111507.13049297635620898.horikyota.ntt@gmail.com 21 September 2022, 10:29:38 UTC
f9a56e7 Disable -Wdeprecated-non-prototype in the back branches. There doesn't seem to be any good ABI-preserving way to silence clang 15's -Wdeprecated-non-prototype warnings about our tree-walk APIs. While we've fixed it properly in HEAD, the only way to not see hundreds of these in the back branches is to disable the warnings. We're not going to do anything about them, so we might as well disable them. I noticed that we also get some of these warnings about fmgr.c's support for V0 function call convention, in branches before v10 where we removed that. That's another area we aren't going to change, so turning off the warning seems fine for that too. Per project policy, this is a candidate for back-patching into out-of-support branches: it suppresses annoying compiler warnings but changes no behavior. Hence, back-patch all the way to 9.2. Discussion: https://postgr.es/m/CA+hUKGKpHPDTv67Y+s6yiC8KH5OXeDg6a-twWo_xznKTcG0kSA@mail.gmail.com 20 September 2022, 22:59:53 UTC
b7d9b0c Suppress variable-set-but-not-used warnings from clang 15. clang 15+ will issue a set-but-not-used warning when the only use of a variable is in autoincrements (e.g., "foo++;"). That's perfectly sensible, but it detects a few more cases that we'd not noticed before. Silence the warnings with our usual methods, such as PG_USED_FOR_ASSERTS_ONLY, or in one case by actually removing a useless variable. One thing that we can't nicely get rid of is that with %pure-parser, Bison emits "yynerrs" as a local variable that falls foul of this warning. To silence those, I inserted "(void) yynerrs;" in the top-level productions of affected grammars. Per recently-established project policy, this is a candidate for back-patching into out-of-support branches: it suppresses annoying compiler warnings but changes no behavior. Hence, back-patch to 9.5, which is as far as these patches go without issues. (A preliminary check shows that the prior branches need some other set-but-not-used cleanups too, so I'll leave them for another day.) Discussion: https://postgr.es/m/514615.1663615243@sss.pgh.pa.us 20 September 2022, 16:04:37 UTC
c922f92 Disable autovacuum in MERGE test script Otherwise, it can fail given sufficient bad luck. Backpatch to 15. Discussion: https://postgr.es/m/537759.1663625579@sss.pgh.pa.us 20 September 2022, 10:38:48 UTC
05af876 doc: Fix parameter name for pg_create_logical_replication_slot() The parameter controlling if two-phase transactions can be decoded was named "two_phase" in the documentation while its procedure defines "twophase". Author: Florin Irion Discussion: https://postgr.es/m/5eeabd10-1aff-ea61-f92d-9fa0d9a7e207@gmail.com Backpatch-through: 14 20 September 2022, 10:28:43 UTC
449f1d0 Fix incorrect variable types for origin IDs in decode.c These variables used XLogRecPtr instead of RepOriginId. Author: Masahiko Sawada Discussion: https://postgr.es/m/CAD21AoBm-vNyBSXGp4bmJGvhr=S-EGc5q1dtV70cFTcJvLhC=Q@mail.gmail.com Backpatch-through: 14 20 September 2022, 09:13:39 UTC
1ec2d0b Fix misleading comment for get_cheapest_group_keys_order The header comment for get_cheapest_group_keys_order() claimed that the output arguments were set to a newly allocated list which may be freed by the calling function, however, this was not always true as the function would simply leave these arguments untouched in some cases. This tripped me up when working on 1349d2790 as I mistakenly assumed I could perform a list_concat with the output parameters. That turned out bad due to list_concat modifying the original input lists. In passing, make it more clear that the number of distinct values is important to reduce tiebreaks during sorts. Also, explain what the n_preordered parameter means. Backpatch-through: 15, where get_cheapest_group_keys_order was introduced. 19 September 2022, 22:04:13 UTC
f6c70b8 Fix out-dated comment in preprocess_groupclause() The comment claimed we don't consider other orders of the GROUP BY clause, but this is no longer true as of db0d67db2. Discussion: https://postgr.es/m/CAApHDvq65=9Ro+hLX1i9ugWEiNDvHrBibAO7ARcTnf38_JE+UQ@mail.gmail.com Backpatch-through: 15, where db0d67db2 was introduced. 19 September 2022, 21:15:04 UTC
7fbf9b1 Fix icu tests with C locale Similar to 1e08576691bf1a25c0e28745e5e800c44f2a1c76, but for the icu test suite. Reported-by: Christoph Berg <myon@debian.org> Discussion: https://www.postgresql.org/message-id/YyWeU61YMFwjVdxE@msg.df7cb.de 19 September 2022, 19:39:49 UTC
c403f97 Future-proof the recursion inside ExecShutdownNode(). The API contract for planstate_tree_walker() callbacks is that they take a PlanState pointer and a context pointer. Somebody figured they could save a couple lines of code by ignoring that, and passing ExecShutdownNode itself as the walker even though it has but one argument. Somewhat remarkably, we've gotten away with that so far. However, it seems clear that the upcoming C2x standard means to forbid such cases, and compilers that actively break such code likely won't be far behind. So spend the extra few lines of code to do it honestly with a separate walker function. In HEAD, we might as well go further and remove ExecShutdownNode's useless return value. I left that as-is in back branches though, to forestall complaints about ABI breakage. Back-patch, with the thought that this might become of practical importance before our stable branches are all out of service. It doesn't seem to be fixing any live bug on any currently known platform, however. Discussion: https://postgr.es/m/208054.1663534665@sss.pgh.pa.us 19 September 2022, 16:16:02 UTC
e4861b2 Improve GUC description punctuation partial backpatch of 0b039e3a8489c08ec61b4d40382047c389af91ad 19 September 2022, 10:45:23 UTC
cacf12e Add missing serial commas 19 September 2022, 10:38:53 UTC
1ef00af Make check_usermap() parameter names consistent. The function has a bool argument named "case_insensitive", but that was spelled "case_sensitive" in the declaration. Make them consistent now to avoid confusion in the future. Author: Peter Geoghegan <pg@bowt.ie> Reviewed-By: Michael Paquiër <michael@paquier.xyz> Discussion: https://postgr.es/m/CAH2-WznJt9CMM9KJTMjJh_zbL5hD9oX44qdJ4aqZtjFi-zA3Tg@mail.gmail.com Backpatch: 10- 17 September 2022, 23:54:16 UTC
940c1c7 Include c.h instead of postgres.h in src/port/*p{read,write}*.c Frontend code shouldn't include postgres.h. Some files in src/port/ need to include postgres.h/postgres_fe.h, but these files don't. Discussion: https://postgr.es/m/20220915022626.5xx3ccgkzpkqw5mq@awork3.anarazel.de Backpatch: 12-, where 3fd2a7932ef introduced (some) of these files 17 September 2022, 16:23:49 UTC
fb50379 pgstat: Create memory contexts below TopMemoryContext So far they were created below CacheMemoryContext. However, that's not guaranteed to exist in all situations, leading to memory contexts created as top-level contexts. There isn't actually a good reason anymore to create them below CacheMemoryContext, so just creating them below TopMemoryContext seems the best approach. Reported-by: Reid Thompson <reid.thompson@crunchydata.com> Reviewed-by: Kyotaro Horiguchi <horikyota.ntt@gmail.com> Reviewed-by: Andres Freund <andres@anarazel.de> Author: "Drouvot, Bertrand" <bdrouvot@amazon.com> Discussion: https://postgr.es/m/b948b729-42fe-f88c-2f4a-0e65d84c049b@amazon.com Backpatch: 15- 17 September 2022, 16:06:47 UTC
23bcc8d Message style improvements 17 September 2022, 06:10:59 UTC
885826f Fix race condition in stats.sql added in 5264add7847 Very occasionally the stats test failed due to the number of sessions not being updated yet. Likely this requires that there is contention on the database's stats entry. Solve this by forcing pending stats to be flushed before fetching the stats. I verified that there are no other test failures after making pgstat_report_stat() only flush stats when force = true. Per message from Tom Lane and buildfarm member crake. Discussion: https://postgr.es/m/3428246.1663271992@sss.pgh.pa.us Backpatch: 15-, where 5264add7847 added the test 16 September 2022, 18:28:20 UTC
b759bb6 Improve plpgsql's ability to handle arguments declared as RECORD. Treat arguments declared as RECORD as if that were a polymorphic type (which it is, sort of), in that we substitute the actual argument type while forming the function cache lookup key. This allows the specific composite type to be known in some cases where it was not before, at the cost of making a separate function cache entry for each named composite type that's passed to the function during a session. The particular symptom discussed in bug #17610 could be solved in other more-efficient ways, but only at the cost of considerable development work, and there are other cases where we'd still fail without this. Per bug #17610 from Martin Jurča. Back-patch to v11 where we first allowed plpgsql functions to be declared as taking type RECORD. Discussion: https://postgr.es/m/17610-fb1eef75bf6c2364@postgresql.org 16 September 2022, 17:23:01 UTC
c946425 Message wording improvements 16 September 2022, 14:37:53 UTC
8135d0b Fix createdb tests for C locale If the createdb tests run under the C locale, the database cluster will be initialized with encoding SQL_ASCII. With the checks added in c7db01e325a530ec38ec7ba57cd3ed32e123e33c, this will cause several ICU-related tests to fail because SQL_ASCII is not supported by ICU. To work around that, use initdb option -E UTF8 for those tests to get past that check. 16 September 2022, 09:15:55 UTC
148f66d Don't allow creation of database with ICU locale with unsupported encoding Check in CREATE DATABASE and initdb that the selected encoding is supported by ICU. Before, they would pass but users would later get an error from the server when they tried to use the database. Also document that initdb sets the encoding to UTF8 by default if the ICU locale provider is chosen. Author: Marina Polyakova <m.polyakova@postgrespro.ru> Reviewed-by: Kyotaro Horiguchi <horikyota.ntt@gmail.com> Discussion: https://www.postgresql.org/message-id/6dd6db0984d86a51b7255ba79f111971@postgrespro.ru 16 September 2022, 07:41:25 UTC
4e2a889 Detect format-string mistakes in the libpq_pipeline test module. I happened to notice that libpq_pipeline's private implementation of pg_fatal lacked any pg_attribute_printf decoration. Indeed, adding that turned up a mistake! We'd likely never have noticed because the error exits in this code are unlikely to get hit, but still, it's a bug. We're so used to having the compiler check this stuff for us that a printf-like function without pg_attribute_printf is a land mine. I wonder if there is a way to detect such omissions. Back-patch to v14 where this code came in. 15 September 2022, 21:17:53 UTC
bfa58a6 Copy-edit docs for logical replication column lists There was a excessive structure, leading to somewhat disorganized presentation of the information. Remove a few tags and reorder paragraphs to make the text flow more easily. Also, reword some of it to be more concise. The bit about column list combination is not modified, other than to remove an uninteresting (and IMO confusing and wrong) paragraph; I intend to deal with it differently afterwards. Backpatch to 15. Discussion: https://postgr.es/m/20220913121138.yn7ekkfysxzhkm2u@alvherre.pgsql 15 September 2022, 16:04:00 UTC
e36cbef Reset InstallXLogFileSegmentActive after walreceiver self-initiated exit. After commit cc2c7d65fc27e877c9f407587b0b92d46cd6dd16 added this flag, failure to reset it caused assertion failures. In non-assert builds, it made the system fail to achieve the objectives listed in that commit; chiefly, we might emit a spurious log message. Back-patch to v15, where that commit first appeared. Bharath Rupireddy and Kyotaro Horiguchi. Reviewed by Dilip Kumar, Nathan Bossart and Michael Paquier. Reported by Dilip Kumar. Discussion: https://postgr.es/m/CAFiTN-sE3ry=ycMPVtC+Djw4Fd7gbUGVv_qqw6qfzp=JLvqT3g@mail.gmail.com 15 September 2022, 13:45:28 UTC
eed5488 Fix grammar in error message While at it, make ellipses formatting consistent when describing SQL statements. Ekaterina Kiryanova and Alexander Lakhin Reviewed by myself and Álvaro Herrera Discussion: https://www.postgresql.org/message-id/eed5cec0-a542-53da-6a5e-7789c6ed9817%40postgrespro.ru Backpatch only the grammar fix to v15 15 September 2022, 04:43:00 UTC
d068b41 Fix outdated convert_saop_to_hashed_saop comment In 29f45e299, we added support for optimizing the execution of NOT IN(values) by using a hash table instead of a linear search over the array. That commit neglected to update the header comment for convert_saop_to_hashed_saop() to mention this fact. Here we fix that. Author: James Coleman Discussion: https://postgr.es/m/CAAaqYe99NUpAPcxgchGstgM23fmiGjqQPot8627YgkBgNt=BfA@mail.gmail.com Backpatch-through: 15, where 29f45e299 was added. 14 September 2022, 21:41:32 UTC
12a5214 Small wording improvements 14 September 2022, 20:32:12 UTC
ef81b7f Remove duplicate initialization This appears to be a merge mistake in 96ef3237bf74. We could put it back the way it was before JSON_TABLE and it'd be two lines shorter, but it's likely that JSON_TABLE will be back and will prefer things this way. It makes no other difference in practice. Backpatch to 15. Reported by Ranier Vilela Discussion: https://postgr.es/m/CAEudQAr4nOcNQskC4oBEZN4S+4heJ=1ch_ZKOxU+_Ef-FQSf-g@mail.gmail.com 14 September 2022, 13:36:21 UTC
64387c5 postgres_fdw: Avoid 'variable not found in subplan target list' error. The tlist of the EvalPlanQual outer plan for a ForeignScan node is adjusted to produce a tuple whose descriptor matches the scan tuple slot for the ForeignScan node. But in the case where the outer plan contains an extra Sort node, if the new tlist contained columns required only for evaluating PlaceHolderVars or columns required only for evaluating local conditions, this would cause setrefs.c to fail with the error. The cause of this is that when creating the outer plan by injecting the Sort node into an alternative local join plan that could emit such extra columns as well, we fail to arrange for the outer plan to propagate them up through the Sort node, causing setrefs.c to fail to match up them in the new tlist to what is available from the outer plan. Repair. Per report from Alexander Pyhalov. Richard Guo and Etsuro Fujita, reviewed by Alexander Pyhalov and Tom Lane. Backpatch to all supported versions. Discussion: http://postgr.es/m/cfb17bf6dfdf876467bd5ef533852d18%40postgrespro.ru 14 September 2022, 09:45:01 UTC
b3c630c Fix incorrect value for "strategy" with deflateParams() in walmethods.c The zlib documentation mentions the values supported for the compression strategy, but this code has been using a hardcoded value of 0 rather than Z_DEFAULT_STRATEGY. This commit adjusts the code to use Z_DEFAULT_STRATEGY. Backpatch down to where this code has been added to ease the backport of any future patch touching this area. Reported-by: Tom Lane Discussion: https://postgr.es/m/1400032.1662217889@sss.pgh.pa.us Backpatch-through: 10 14 September 2022, 05:52:26 UTC
7fe55d5 Expand palloc/pg_malloc API for more type safety This adds additional variants of palloc, pg_malloc, etc. that encapsulate common usage patterns and provide more type safety. Specifically, this adds palloc_object(), palloc_array(), and repalloc_array(), which take the type name of the object to be allocated as its first argument and cast the return as a pointer to that type. There are also palloc0_object() and palloc0_array() variants for initializing with zero, and pg_malloc_*() variants of all of the above. Inspired by the talloc library. This is backpatched from master so that future backpatchable code can make use of these APIs. This patch by itself does not contain any users of these APIs. Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://www.postgresql.org/message-id/flat/bb755632-2a43-d523-36f8-a1e7a389a907@enterprisedb.com 14 September 2022, 04:04:24 UTC
53332ea Simplify handling of compression level with compression specifications PG_COMPRESSION_OPTION_LEVEL is removed from the compression specification logic, and instead the compression level is always assigned with each library's default if nothing is directly given. This centralizes the checks on the compression methods supported by a given build, and always assigns a default compression level when parsing a compression specification. This results in complaining at an earlier stage than previously if a build supports a compression method or not, aka when parsing a specification in the backend or the frontend, and not when processing it. zstd, lz4 and zlib are able to handle in their respective routines setting up the compression level the case of a default value, hence the backend or frontend code (pg_receivewal or pg_basebackup) has now no need to know what the default compression level should be if nothing is specified: the logic is now done so as the specification parsing assigns it. It can also be enforced by passing down a "level" set to the default value, that the backend will accept (the replication protocol is for example able to handle a command like BASE_BACKUP (COMPRESSION_DETAIL 'gzip:level=-1')). This code simplification fixes an issue with pg_basebackup --gzip introduced by ffd5365, where the tarball of the streamed WAL segments would be created as of pg_wal.tar.gz with uncompressed contents, while the intention is to compress the segments with gzip at a default level. The origin of the confusion comes from the handling of the default compression level of gzip (-1 or Z_DEFAULT_COMPRESSION) and the value of 0 was getting assigned, which is what walmethods.c would consider as equivalent to no compression when streaming WAL segments with its tar methods. Assigning always the compression level removes the confusion of some code paths considering a value of 0 set in a specification as either no compression or a default compression level. Note that 010_pg_basebackup.pl has to be adjusted to skip a few tests where the shape of the compression detail string for client and server-side compression was checked using gzip. This is a result of the code simplification, as gzip specifications cannot be used if a build does not support it. Reported-by: Tom Lane Reviewed-by: Tom Lane Discussion: https://postgr.es/m/1400032.1662217889@sss.pgh.pa.us Backpatch-through: 15 14 September 2022, 03:17:03 UTC
3e694b3 Make locale option behavior more consistent Locale options can be specified for initdb, createdb, and CREATE DATABASE. In initdb, it has always been possible to specify --locale and then some --lc-* option to override a category. CREATE DATABASE and createdb didn't allow that, requiring either the all-categories option or only per-category options. In f2553d43060edb210b36c63187d52a632448e1d2, this was changed in CREATE DATABASE (perhaps by accident?) to be more like the initdb behavior, but createdb still had the old behavior. Now we change createdb to match the behavior of CREATE DATABASE and initdb, and also update the documentation of CREATE DATABASE to match the new behavior, which was not done in the above commit. Author: Marina Polyakova <m.polyakova@postgrespro.ru> Reviewed-by: Justin Pryzby <pryzby@telsasoft.com> Discussion: https://www.postgresql.org/message-id/7c99c132dc9c0ac630e0127f032ac480@postgrespro.ru 13 September 2022, 12:18:45 UTC
892cac9 Improve wal_decode_buffer_size description some more Per Thomas Munro Discussion: https://postgr.es/m/CA+hUKGJ9wP9kpvgoxHvqA=4g1d9-y_w3LhhdhFVU=mFiqjwHww@mail.gmail.com 13 September 2022, 10:02:56 UTC
f5047c1 Move any remaining files generated by pg_upgrade into an internal subdir This change concerns a couple of .txt files (for internal state checks) that were still written in the path where the binary is executed, and not in the subdirectory located in the target cluster. Like the other .txt files doing already so (like loadable_libraries.txt), these are saved in the base output directory. Note that on failure, the logs report the full path to the .txt file generated, so these are easy to find. Oversight in 38bfae3. Author: Daniel Gustafsson Reviewed-by: Michael Paquier, Justin Prysby Discussion: https://postgr.es/m/181A6DA8-3B7F-4B71-82D5-363FF0146820@yesql.se Backpatch-through: 15 13 September 2022, 01:38:59 UTC
4d5d358 Don't reference out-of-bounds array elements in brin_minmax_multi.c The primary fix here is to fix has_matching_range() so it does not reference ranges->values[-1] when nranges == 0. Similar problems existed in AssertCheckRanges() too. It does not look like any of these problems could lead to a crash as the array in question is at the end of the Ranges struct, and values[-1] is memory that belongs to other fields in the struct. However, let's get rid of these rather unsafe coding practices. In passing, I (David) adjusted some comments to try to make it more clear what some of the fields are for in the Ranges struct. I had to study the code to find out what nsorted was for as I couldn't tell from the comments. Author: Ranier Vilela Discussion: https://postgr.es/m/CAEudQAqJQzPitufX-jR=YUbJafpCDAKUnwgdbX_MzSc93wuvdw@mail.gmail.com Backpatch-through: 14, where multi-range brin was added. 12 September 2022, 23:04:37 UTC
7d7d72c doc: Fix link to FreeBSD documentation project The FreeBSD site was changed with a redirect, which in turn seems to lead to a 404. Replace with the working link. Author: James Coleman <jtc331@gmail.com> Discussion: https://postgr.es/m/CAAaqYe_JZRj+KPn=hACtwsg1iLRYs=jYvxG1NW4AnDeUL1GD-Q@mail.gmail.com 12 September 2022, 20:17:17 UTC
cb49042 Add list of acknowledgments to release notes This contains all individuals mentioned in the commit messages during PostgreSQL 15 development. current through REL_15_BETA4 12 September 2022, 14:51:00 UTC
56d2388 Fix NaN comparison in circle_same test Commit c4c340088 changed geometric operators to use float4 and float8 functions, and handle NaN's in a better way. The circle sameness test had a typo in the code which resulted in all comparisons with the left circle having a NaN radius considered same. postgres=# select '<(0,0),NaN>'::circle ~= '<(0,0),1>'::circle; ?column? ---------- t (1 row) This fixes the sameness test to consider the radius of both the left and right circle. Backpatch to v12 where this was introduced. Author: Ranier Vilela <ranier.vf@gmail.com> Discussion: https://postgr.es/m/CAEudQAo8dK=yctg2ZzjJuzV4zgOPBxRU5+Kb+yatFiddtQk6Rw@mail.gmail.com Backpatch-through: v12 12 September 2022, 10:59:06 UTC
c8a1bc0 Use float8 datatype for percentiles in pg_walinspect stat functions pg_walinspect uses datatype double (double precision floating point number) for WAL stats percentile calculations and expose them via float4 (single precision floating point number), which an unnecessary loss of precision and confusing. Even though, it's harmless that way, let's use float8 (double precision floating-point number) to be in sync with what pg_walinspect does internally and what it exposes to the users. This seems to be the pattern used elsewhere in the code. Reported-by: Peter Eisentraut Author: Bharath Rupireddy Reviewed-by: Peter Eisentraut Discussion: https://www.postgresql.org/message-id/36ee692b-232f-0484-ce94-dc39d82021ad%40enterprisedb.com 12 September 2022, 07:38:07 UTC
44a51dc Doc: improve explanation of when custom GUCs appear in pg_settings. Be more clear about when and how an extension-defined GUC comes to be visible in pg_settings. (Move the para to the bottom of the page, too; whoever thought this point was more important than the para about the view being updatable had odd priorities IMNSHO.) Back-patch to v15 where archive modules were added, since that seems to have made this more of a sore spot than it was before. Benoit Lobréau, Nathan Bossart Discussion: https://postgr.es/m/CAPE8EZ7KHaXMHKwT=HOim23tDVKYA1PruRuTfeYdCrYWwPGhag@mail.gmail.com 10 September 2022, 20:42:25 UTC
fbb54d7 Fix possible omission of variable storage markers in ECPG. The ECPG preprocessor converted code such as static varchar str1[10], str2[20], str3[30]; into static struct varchar_1 { int len; char arr[ 10 ]; } str1 ; struct varchar_2 { int len; char arr[ 20 ]; } str2 ; struct varchar_3 { int len; char arr[ 30 ]; } str3 ; thus losing the storage attribute for the later variables. Repeat the declaration for each such variable. (Note that this occurred only for variables declared "varchar" or "bytea", which may help explain how it escaped detection for so long.) Andrey Sokolov Discussion: https://postgr.es/m/942241662288242@mail.yandex.ru 09 September 2022, 19:34:04 UTC
e0636ca Doc: improve documentation about where the psqlrc files are. Remove no-longer-accurate claim that Windows lacks home directories. Clarify the text by more clearly distinguishing which statements reflect hard-wired choices versus which ones reflect overridable defaults. Update the examples of version-specific file names, and make them track future version changes by using "&majorversion;" and "&version;". (BTW, in devel and beta releases this method correctly says that you can use strings like "16devel" and "15beta4" as minor version identifiers.) Back-patch to v15, but not further, with the thought that in older releases the examples with three-part version numbers still had some historical relevance. v15 will be the first major release after the last 9.x branch went out of support. Robert Treat and Tom Lane, reviewed by Julien Rouhaud Discussion: https://postgr.es/m/CAJSLCQ07F-WCYYYOY8+dWhHcVeJ1Pb01cWc-c0Hu=M3EjKT2Eg@mail.gmail.com 09 September 2022, 17:50:42 UTC
100a8ca Reject bogus output from uuid_create(3). When using the BSD UUID functions, contrib/uuid-ossp expects uuid_create() to produce a version-1 UUID. FreeBSD still does so, but in recent NetBSD releases that function produces a version-4 (random) UUID instead. That's not acceptable for our purposes: if the user wanted v4 she would have asked for v4, not v1. Hence, check the version digit and complain if it's not '1'. Also drop the documentation's claim that the NetBSD implementation is usable. It might be, depending on which OS version you're using, but we're not going to get into that kind of detail. (Maybe someday we should ditch all these external libraries and just write our own UUID code, but today is not that day.) Nazir Bilal Yavuz, with cosmetic adjustments and docs by me. Backpatch to all supported versions. Discussion: https://postgr.es/m/3848059.1661038772@sss.pgh.pa.us Discussion: https://postgr.es/m/17358-89806e7420797025@postgresql.org 09 September 2022, 16:41:36 UTC
5bb8896 Doc fixes for MERGE statement In commit 3d895bc846f2 I introduced a bogus semicolon mid-statement by careless cut-n-paste; move it. This had already been reported by Justin Pryzby. Also, change the styling a bit by avoiding names in CamelCase. This is more consistent with the style we use elsewhere. Backpatch to 15. Author: Vitaly Burovoy <vitaly.burovoy@gmail.com> Reviewed-by: Vik Fearing <vik@postgresfriends.org> Discussion: https://postgr.es/m/9afe5766-5a61-7860-598c-136867fad065@gmail.com Discussion: https://postgr.es/m/20220819133016.GV26426@telsasoft.com 09 September 2022, 11:51:45 UTC
68b0da6 Fix GetForeignKey*Triggers for self-referential FKs Because of inadequate filtering, the check triggers were confusing the search for action triggers in GetForeignKeyActionTriggers and vice-versa in GetForeignKeyCheckTriggers; this confusion results in seemingly random assertion failures, and can have real impact in non-asserting builds depending on catalog order. Change these functions so that they correctly ignore triggers that are not relevant to each side. To reduce the odds of further problems, do not break out of the searching loop in assertion builds. This break is likely to hide bugs; without it, we would have detected this bug immediately. This problem was introduced by f4566345cf40, so backpatch to 15 where that commit first appeared. Author: Amit Langote <amitlangote09@gmail.com> Discussion: https://postgr.es/m/20220908172029.sejft2ppckbo6oh5@awork3.anarazel.de Discussion: https://postgr.es/m/4104619.1662663056@sss.pgh.pa.us 09 September 2022, 10:22:20 UTC
0a7c9ee Add more error context to RestoreBlockImage() and consume it On failure in restoring a block image, no details were provided, while it is possible to see failure with an inconsistent record state, a failure in processing decompression or a failure in decompression because a build does not support this option. RestoreBlockImage() is used in two code paths in the backend code, during recovery and when checking a page consistency after applying masking, and both places are changed to consume the error message produced by the internal routine when it returns a false status. All the error messages are reported under ERRCODE_INTERNAL_ERROR, that gets used also when attempting to access a page compressed by a method not supported by the build attempting the decompression. This is something that can happen in core when doing physical replication with primary and standby using inconsistent build options, for example. This routine is available since 2c03216d and it has never provided any context about the error happening when it failed. This change is justified even more after 57aa5b2, that introduced compression of FPWs in WAL. Reported-by: Justin Prysby Author: Michael Paquier Discussion: https://postgr.es/m/20220905002320.GD31833@telsasoft.com Backpatch-through: 15 09 September 2022, 01:01:14 UTC
ade2409 Choose FK name correctly during partition attachment During ALTER TABLE ATTACH PARTITION, if the name of a parent's foreign key constraint is already used on the partition, the code tries to choose another one before the FK attributes list has been populated, so the resulting constraint name was "<relname>__fkey" instead of "<relname>_<attrs>_fkey". Repair, and add a test case. Backpatch to 12. In 11, the code to attach a partition was not smart enough to cope with conflicting constraint names, so the problem doesn't exist there. Author: Jehan-Guillaume de Rorthais <jgdr@dalibo.com> Discussion: https://postgr.es/m/20220901184156.738ebee5@karst 08 September 2022, 11:17:02 UTC
dd38ff2 Fix recovery_prefetch with low maintenance_io_concurrency. We should process completed IOs *before* trying to start more, so that it is always possible to decode one more record when the decoded record queue is empty, even if maintenance_io_concurrency is set so low that a single earlier WAL record might have saturated the IO queue. That bug was hidden because the effect of maintenance_io_concurrency was arbitrarily clamped to be at least 2. Fix the ordering, and also remove that clamp. We need a special case for 0, which is now treated the same as recovery_prefetch=off, but otherwise the number is used directly. This allows for testing with 1, which would have made the problem obvious in simple test scenarios. Also add an explicit error message for missing contrecords. It was a bit strange that we didn't report an error already, and became a latent bug with prefetching, since the internal state that tracks aborted contrecords would not survive retrying, as revealed by 026_overwrite_contrecord.pl with this adjustment. Reporting an error prevents that. Back-patch to 15. Reported-by: Justin Pryzby <pryzby@telsasoft.com> Reviewed-by: Kyotaro Horiguchi <horikyota.ntt@gmail.com> Discussion: https://postgr.es/m/20220831140128.GS31833%40telsasoft.com 08 September 2022, 08:36:44 UTC
back to top