aboutsummaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAge
* Rationalize order of input files for gen_node_support.pl.Tom Lane2022-07-11
| | | | | | | | Per a question from Andres Freund. While here, also make the list of nodetag-only files easier to compare to the full list of input files. Discussion: https://postgr.es/m/20220710214622.haiektrjzisob6rl@awork3.anarazel.de
* Fix mistake in comment.Robert Haas2022-07-11
| | | | | | Kyotaro Horiguchi Discussion: http://postgr.es/m/20220708.145951.382076151410075693.horikyota.ntt@gmail.com
* Convert macros to static inline functions (bufpage.h)Peter Eisentraut2022-07-11
| | | | | | | | | | | | Remove PageIsValid() and PageSizeIsValid(), which weren't used and seem unnecessary. Some code using these formerly-macros needs some adjustments because it was previously playing loose with the Page vs. PageHeader types, which is no longer possible with the functions instead of macros. Reviewed-by: Amul Sul <sulamul@gmail.com> Discussion: https://www.postgresql.org/message-id/flat/5b558da8-99fb-0a99-83dd-f72f05388517%40enterprisedb.com
* Fix lock assertions in dshash.c.Thomas Munro2022-07-11
| | | | | | | | | | | | | | | | | | | | | | | | | dshash.c previously maintained flags to be able to assert that you didn't hold any partition lock. These flags could get out of sync with reality in error scenarios. Get rid of all that, and make assertions about the locks themselves instead. Since LWLockHeldByMe() loops internally, we don't want to put that inside another loop over all partition locks. Introduce a new debugging-only interface LWLockAnyHeldByMe() to avoid that. This problem was noted by Tom and Andres while reviewing changes to support the new shared memory stats system, and later showed up in reality while working on commit 389869af. Back-patch to 11, where dshash.c arrived. Reported-by: Tom Lane <tgl@sss.pgh.pa.us> Reported-by: Andres Freund <andres@anarazel.de> Reviewed-by: Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp> Reviewed-by: Zhihong Yu <zyu@yugabyte.com> Reviewed-by: Andres Freund <andres@anarazel.de> Discussion: https://postgr.es/m/20220311012712.botrpsikaufzteyt@alap3.anarazel.de Discussion: https://postgr.es/m/CA%2BhUKGJ31Wce6HJ7xnVTKWjFUWQZPBngxfJVx4q0E98pDr3kAw%40mail.gmail.com
* Build de-escaped JSON strings in larger chunks during lexingJohn Naylor2022-07-11
| | | | | | | | | | | | | | | | During COPY BINARY with large JSONB blobs, it was found that half the time was spent parsing JSON, with much of that spent in separate appendStringInfoChar() calls for each input byte. Add lookahead loop to json_lex_string() to allow batching multiple bytes via appendBinaryStringInfo(). Also use this same logic when de-escaping is not done, to avoid code duplication. Report and proof of concept patch by Jelte Fennema, reworked by Andres Freund and John Naylor Discussion: https://www.postgresql.org/message-id/CAGECzQQuXbies_nKgSiYifZUjBk6nOf2%3DTSXqRjj2BhUh8CTeA%40mail.gmail.com Discussion: https://www.postgresql.org/message-id/flat/PR3PR83MB0476F098CBCF68AF7A1CA89FF7B49@PR3PR83MB0476.EURPRD83.prod.outlook.com
* Fix two portability issues with the tests of test_oat_hooksMichael Paquier2022-07-11
| | | | | | | | | | | | | | | | | | | | | | | | This addresses two issues in the tests of test_oat_hooks: - The role regress_test_user was being left behind, preventing the test to succeed on repeated runs. It makes sense to leave some objects behind to have more coverage for pg_upgrade (as does test_pg_dump), but the role dropped here does not own any objects so there is no reason to keep it. - GRANT SET ON PARAMETER is issued, creating an entry in pg_parameter_acl without cleaning up the entry created. This causes an overlap with unsafe_tests as both use work_mem, making the latter fail. This commit adds an extra REVOKE SET ON PARAMETER to clean the contents of pg_parameter_acl, switching to maintenance_work_mem rather than work_mem to avoid an overlap between both tests. The tests of test_oat_hooks cannot use installcheck yet as these are proving to be unstable with caching and the namespace search hooks, so the issues fixed here cannot be reached yet, but they would be once the hook issue is addressed and installcheck is allowed again in test_oat_hooks. Discussion: https://postgr.es/m/YrpVkADAY0knF6vM@paquier.xyz Backpatch-through: 15
* Improve error message with JSON_SERIALIZE()Michael Paquier2022-07-11
| | | | | | | | | | The error message introduced in 3c633f3 can share the same format string with an existing message used for JSON(), reducing the translation effort. Author: Kyotaro Horiguchi Discussion: https://postgr.es/m/20220708.154135.2123613118233840495.horikyota.ntt@gmail.com Backpatch-through: 15
* Improve two comments related to a boolean DefElem's valueMichael Paquier2022-07-11
| | | | | | | | | | | | The original comments mentioned a "parameter" as something not defined in a fast-exit path to assume a true status. This is rather confusing as the parameter DefElem is defined, and the intention is to check if its value is defined. This improves both comments to mention the value assigned to the DefElem's value instead, so as future patches are able to catch the tweak if this code pattern gets copied around more. Author: Peter Smith Discussion: https://postgr.es/m/CAHut+Pv0yWynWTmp4o34s0d98xVubys9fy=p0YXsZ5_sUcNnMw@mail.gmail.com
* Tidy up claimed supported CPUs and OSes.Thomas Munro2022-07-11
| | | | | | | | | | | | | | | | | | * Remove arbitrary mention of certain endianness and bitness variants; it's enough to say that applicable variants are expected to work. * List RISC-V (known to work, being tested). * List SuperH and M88K (code exists, unknown status, like M68K). * De-list VAX and remove code (known not to work). * Remove stray trace of Alpha (support was removed years ago). * List illumos, DragonFlyBSD (known to work, being tested). * No need to single Windows out by listing a specific version, when we don't do that for other OSes; it's enough to say that we support current versions of the listed OSes (when 16 ships, that'll be Windows 10+). Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Reviewed-by: Greg Stark <stark@mit.edu> Discussion: https://postgr.es/m/CA%2BhUKGKk7NZO1UnJM0PyixcZPpCGqjBXW_0bzFZpJBGAf84XKg%40mail.gmail.com
* Fix \watch's interaction with libedit on ^C.Thomas Munro2022-07-10
| | | | | | | | | | | | | | When you hit ^C, the terminal driver in Unix-like systems echoes "^C" as well as sending an interrupt signal (depending on stty settings). At least libedit (but maybe also libreadline) is then confused about the current cursor location, and corrupts the display if you try to scroll back. Fix, by moving to a new line before the next prompt is displayed. Back-patch to all supported released. Author: Pavel Stehule <pavel.stehule@gmail.com> Reported-by: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://postgr.es/m/3278793.1626198638%40sss.pgh.pa.us
* Exclude nodetags.h from headerscheck and cpluspluscheck.Tom Lane2022-07-09
| | | | | Since this file contains just a fragment of an enum declaration, it can't be compiled on its own.
* Make assorted quality-of-life improvements in gen_node_support.pl.Tom Lane2022-07-09
| | | | | | | | | | Fix incorrect reporting of the location of errors (such as bogus node attributes). Add header comments to the generated files, containing copyright notices and reminders that they are generated files, as we do in other file-generating scripts. Arrange to not leave a clutter of temporary files when the script detects an error. Discussion: https://postgr.es/m/3843645.1657385930@sss.pgh.pa.us
* Doc: rearrange high-level commentary about node support coverage.Tom Lane2022-07-09
| | | | | | | | | copyfuncs.c and friends no longer seem like great places to put high-level remarks about what's covered and what isn't. Move that material to backend/nodes/README and other more-prominent places. Add back (versions of) some remarks that disappeared in 2be87f092. Discussion: https://postgr.es/m/3843645.1657385930@sss.pgh.pa.us
* Mark Scan as an abstract node type, too.Tom Lane2022-07-09
| | | | On further review, this one is never instantiated either.
* Mark PlanState as an abstract node type.Tom Lane2022-07-09
| | | | | | | | | In the same vein as commit 251154beb, make it clear that we never instantiate PlanState. Also mark MemoryContextData as abstract. This has no effect right now, since memnodes.h isn't one of the files fed to gen_node_support.pl. But it seems like good documentation and future-proofing.
* Remove code sections obsoleted by node support automationPeter Eisentraut2022-07-09
| | | | | This removes the code sections that were ifdef'ed out by 964d01ae90c314eb31132c2e7712d5d9fc237331.
* Move a commentPeter Eisentraut2022-07-09
| | | | | Move a comment from the to-be-deleted section of nodes.h to where it might still be useful.
* Add generated nodes\nodetags.h to clean.batPeter Eisentraut2022-07-09
|
* Install generated nodes/nodetags.hPeter Eisentraut2022-07-09
|
* Fix vpath buildPeter Eisentraut2022-07-09
|
* Automatically generate node support functionsPeter Eisentraut2022-07-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a script to automatically generate the node support functions (copy, equal, out, and read, as well as the node tags enum) from the struct definitions. For each of the four node support files, it creates two include files, e.g., copyfuncs.funcs.c and copyfuncs.switch.c, to include in the main file. All the scaffolding of the main file stays in place. I have tried to mostly make the coverage of the output match what is currently there. For example, one could now do out/read coverage of utility statement nodes, but I have manually excluded those for now. The reason is mainly that it's easier to diff the before and after, and adding a bunch of stuff like this might require a separate analysis and review. Subtyping (TidScan -> Scan) is supported. For the hard cases, you can just write a manual function and exclude generating one. For the not so hard cases, there is a way of annotating struct fields to get special behaviors. For example, pg_node_attr(equal_ignore) has the field ignored in equal functions. (In this patch, I have only ifdef'ed out the code to could be removed, mainly so that it won't constantly have merge conflicts. It will be deleted in a separate patch. All the code comments that are worth keeping from those sections have already been moved to the header files where the structs are defined.) Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://www.postgresql.org/message-id/flat/c1097590-a6a4-486a-64b1-e1f9cc0533ce%40enterprisedb.com
* Add missing inequality searches to rbtreeAlexander Korotkov2022-07-08
| | | | | | | | | | | | PostgreSQL contains the implementation of the red-black tree. The red-black tree is the ordered data structure, and one of its advantages is the ability to do inequality searches. This commit adds rbt_find_less() and rbt_find_great() functions implementing these searches. While these searches aren't yet used in the core code, they might be useful for extensions. Discussion: https://postgr.es/m/CAGRrpzYE8-7GCoaPjOiL9T_HY605MRax-2jgTtLq236uksZ1Sw%40mail.gmail.com Author: Steve Chavez, Alexander Korotkov Reviewed-by: Alexander Korotkov
* Use C99 designator in the rbtree sentinel definitionAlexander Korotkov2022-07-08
| | | | | | | | This change should improve the code readability. Discussion: https://postgr.es/m/CAGRrpzYE8-7GCoaPjOiL9T_HY605MRax-2jgTtLq236uksZ1Sw%40mail.gmail.com Author: Steve Chavez, Alexander Korotkov Reviewed-by: Alexander Korotkov
* Preserve relfilenode of pg_largeobject and its index across pg_upgrade.Robert Haas2022-07-08
| | | | | | | | | | | | | | | | | | | | Commit 9a974cbcba005256a19991203583a94b4f9a21a9 did this for user tables, but pg_upgrade treats pg_largeobject as a user table, and so needs the same treatment. Without this fix, if you rewrite the pg_largeobject table and then perform an upgrade with pg_upgrade, the table will apparently be empty on the new cluster, while all of your objects will end up with an orphaned file. With this fix, instead of the old cluster's pg_largeobject files ending up orphaned, the original files fro the new cluster do. That's mostly harmless because we expect the table to be empty, but we might want to arrange to remove the as part of the upgrade. Since we're still debating the best way of doing that, I (rhaas) have decided to postpone dealing with that problem and get the basic fix committed. Justin Pryzby, reviewed by Shruthi Gowda and by me. Discussion: http://postgr.es/m/20220701231413.GI13040@telsasoft.com
* Adjust node serialization tag of A_Expr for consistencyPeter Eisentraut2022-07-08
| | | | | | Changed from AEXPR to A_EXPR for consistency. Discussion: https://www.postgresql.org/message-id/2592455.1657140387%40sss.pgh.pa.us
* Remove T_Join and T_PlanPeter Eisentraut2022-07-08
| | | | | | | These are abstract node types that don't need to have a node tag defined. Discussion: https://www.postgresql.org/message-id/2592455.1657140387%40sss.pgh.pa.us
* Simplify json lexing stateJohn Naylor2022-07-08
| | | | | | | | | | | Instead of updating the length as we go, use a const pointer to end of the input, which we know already at the start. This simplifies the coding and may improve performance slightly, but the real motivation for doing this is to make further changes in this area easier to reason about. Discussion: https://www.postgresql.org/message-id/CAFBsxsGhaR2KQ5eisaK%3D6Vm60t%3DaxhD8Ckj1qFoCH1pktZi%2B2w%40mail.gmail.com
* Reformat some more node commentsPeter Eisentraut2022-07-08
| | | | | | | | Reformat some more comments in node field definitions to avoid long lines. Similar to 835d476fd21bcfb60b055941dee8c3d9559af14c, based on additional per-field annotations that will be required. Discussion: https://www.postgresql.org/message-id/c5906b07-220a-a3d4-8ff3-8ee593009424@enterprisedb.com
* Remove HP/Intel Itanium support.Thomas Munro2022-07-08
| | | | | | | | | | | | | This CPU architecture has been discontinued. We already removed HP-UX support, we never supported Windows/Itanium, and the open source operating systems that a vintage hardware owner might hope to run have all either ended Itanium support or never fully released support (NetBSD may eventually). The extra code we carry for this rare ISA is now untested. It seems like a good time to remove it. Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Reviewed-by: Andres Freund <andres@anarazel.de> Discussion: https://postgr.es/m/1415825.1656893299%40sss.pgh.pa.us
* Remove HP-UX port.Thomas Munro2022-07-08
| | | | | | | | | | | | | | | | | HP-UX hardware is no longer produced, build farm coverage recently ended, and there are no known active maintainers targeting this OS. Since there is a major rewrite of the build system in the pipeline for PostgreSQL 16, and that requires development, testing and maintainance for each OS and tool chain, it seems like a good time to drop support for: * HP-UX, the operating system. * HP aCC, the HP-UX native compiler. Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Reviewed-by: Andres Freund <andres@anarazel.de> Reviewed-by: Peter Eisentraut <peter.eisentraut@enterprisedb.com> Discussion: https://postgr.es/m/1415825.1656893299%40sss.pgh.pa.us
* Only allow returning string types or bytea from json_serializeAndrew Dunstan2022-07-07
| | | | | | | | | | These are documented to be the allowed types for the RETURNING clause, but the restriction was not being enforced, which caused a segfault if another type was specified. Add some testing for this. Per report from a.kozhemyakin Backpatch to release 15.
* Remove stray references to lefttree/righttree in the executor.Tom Lane2022-07-07
| | | | | | | | | | | | | The general convention in the executor is to refer to child plans and planstates via the outerPlan[State] and innerPlan[State] macros, but a few places didn't do it like that. For consistency and readability, convert all the stragglers to use the macros. (See also commit 40f42d2a3, which did some similar cleanup a few years ago, but missed these cases.) Richard Guo Discussion: https://postgr.es/m/CAMbWs4-vYhh1xsa_veah4PUed2Xq=Ed_YH3=Mqt5A3Y=EgfCEg@mail.gmail.com
* Add checkpoint and REDO LSN to log_checkpoints message.Fujii Masao2022-07-07
| | | | | | | | | | | | | It is useful for debugging purposes to report the checkpoint LSN and REDO LSN in log_checkpoints message. It can give more context while analyzing checkpoint-related issues. pg_controldata reports the last checkpoint LSN and REDO LSN, but having this information alongside the log message helps analyze issues that happened previously, connect the dots and identify the root cause. Author: Bharath Rupireddy, Kyotaro Horiguchi Reviewed-by: Michael Paquier, Julien Rouhaud, Nathan Bossart, Fujii Masao, Greg Stark Discussion: https://postgr.es/m/CALj2ACWt6kqriAHrO+AJj+OmP=suwbktHT5JoYAn-nqZe2gd2g@mail.gmail.com
* Fix alias matching in transformLockingClause().Dean Rasheed2022-07-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | When locking a specific named relation for a FOR [KEY] UPDATE/SHARE clause, transformLockingClause() finds the relation to lock by scanning the rangetable for an RTE with a matching eref->aliasname. However, it failed to account for the visibility rules of a join RTE. If a join RTE doesn't have a user-supplied alias, it will have a generated eref->aliasname of "unnamed_join" that is not visible as a relation name in the parse namespace. Such an RTE needs to be skipped, otherwise it might be found in preference to a regular base relation with a user-supplied alias of "unnamed_join", preventing it from being locked. In addition, if a join RTE doesn't have a user-supplied alias, but does have a join_using_alias, then the RTE needs to be matched using that alias rather than the generated eref->aliasname, otherwise a misleading "relation not found" error will be reported rather than a "join cannot be locked" error. Backpatch all the way, except for the second part which only goes back to 14, where JOIN USING aliases were added. Dean Rasheed, reviewed by Tom Lane. Discussion: https://postgr.es/m/CAEZATCUY_KOBnqxbTSPf=7fz9HWPnZ5Xgb9SwYzZ8rFXe7nb=w@mail.gmail.com
* Convert macros to static inline functions (block.h)Peter Eisentraut2022-07-07
| | | | | | | | | | | | | Remove BlockIdIsValid(), which wasn't used and is unnecessary. Remove BlockIdCopy(), which wasn't used and can be done by struct assignment. (BlockIdEquals() also isn't used, but seems reasonable to keep around.) Reviewed-by: Amul Sul <sulamul@gmail.com> Discussion: https://www.postgresql.org/message-id/flat/5b558da8-99fb-0a99-83dd-f72f05388517%40enterprisedb.com
* Make Windows 10 the minimal runtime requirement for WIN32Michael Paquier2022-07-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit bumps the runtime value of _WIN32_WINNT to be 0x0A00 for any builds on Windows. Hence, this makes Windows 10 the minimal requirement when running PostgreSQL under WIN32, be it for builds of Cygwin, MinGW or Visual Studio. The previous minimal runtime version was either Windows Vista when building with at least Visual Studio 2015 or Windows XP for the rest. Windows 10 is the most modern version supported by Microsoft, and per discussion, as we don't have buildfarm members that run older versions anymore, this is the minimal supported version that suits better for our needs. This will actually make easier the development of some patches, two being async I/O and large page handling by avoiding a lot of compatibility gotchas, on platforms that have most likely few users anyway. It is possible to remove MIN_WINNT in win32.h and the macros IsWindowsXXXOrGreater() that were used in the code at runtime to check which version of Windows was getting used. The change in pg_locale.c comes from Juan. Note that all my tests passed, and that the CI is green. The buildfarm will quickly tell if this needs more adjustments. Author: Michael Paquier, Juan José Santamaría Flecha Reviewed-by: Thomas Munro Discussion: https://postgr.es/m/Yo7tHKD8VCkeNi71@paquier.xyz
* Re-order disable_on_error in tab-complete.Amit Kapila2022-07-07
| | | | | | | | | | | | | | By convention, the tab-complete subscription parameters are listed in the COMPLETE_WITH lists in alphabetical order, but when the "disable_on_error" parameter was introduced this was not done. This patch just tidies that up. Reported-by: Peter Smith Author: Peter Smith Reviewed-by: Euler Taveira, Takamichi Osumi Backpatch-through: 15, where it was introduced Discussion: https://postgr.es/m/CAHut+PucvKZgg_eJzUW--iL6DXHg1Jwj6F09tQziE3kUF67uLg@mail.gmail.com
* Clean up some includes and comments in TAP test scriptsMichael Paquier2022-07-07
| | | | | | | | | A few tests included File::Path::rmtree without using it, and a comment related to the segment size for replication slot limits was wrong. Author: Pavel Borisov, Bharath Rupireddy Reviewed-by: Maxim Orlov Discussion: https://postgr.es/m/CALj2ACU4-aNLX=DrUM8F7QDwynJKzYRiqOj_33NhnGbhDs5-kQ@mail.gmail.com
* pgstat: slru: remove outdated commentAndres Freund2022-07-06
| | | | | | | | That comment might have been true at some point during development, but definitely isn't anymore. Reported-By: Melanie Plageman <melanieplageman@gmail.com> Backpatch: 15-
* Fix wrong field order in _readMergeWhenClause().Tom Lane2022-07-06
| | | | | | | | | | | We hadn't noticed this because it's dead code: there is no situation where we read raw parse trees from text format. So maybe the right fix is to remove the function altogether, but I'll forbear for now; it's not the only dead code in readfuncs.c, I think. Noted while comparing existing code to the results of Peter's auto-generation script.
* Overload index_form_tuple to allow the memory context to be suppliedDavid Rowley2022-07-07
| | | | | | | | | | | | | | | | | | | | | | | 40af10b57 changed things so we make use of a generation memory context for storing tuples to be sorted by tuplesort.c. That change does not play nicely with the changes made in 9f03ca915 (back in 2014). That commit changed things so that index_form_tuple() is called while switched into the tuplestore's tuplecontext. In order to fetch the tuple from the index, index_form_tuple() must do various memory allocations which are unrelated to the storage of the final returned tuple. Although all of these allocations are pfree'd, the fact that we now use a generation context means that the memory for these pfree'd allocations won't be used again by any other allocation due to generation.c's lack of freelists. This could result in sorts used for building indexes exceeding maintenance_work_mem by a very large amount. Here we fix it so we no longer allocate anything apart from the tuple itself into the generation context by adding a new version of index_form_tuple named index_form_tuple_context, which can be called to specify the MemoryContext to allocate the tuple into. Discussion: https://postgr.es/m/CAApHDvrHQkiFRHiGiAS-LMOvJN-eK-s762=tVzBz8ZqUea-a_A@mail.gmail.com Backpatch-through: 15, where 40af10b57 was added.
* pgstat: drop subscription stats without slot as well, fix commentAndres Freund2022-07-06
| | | | | | | | | | | | | | There's no reason anymore to only drop subscription stats if associated with a slot, now that stats drops are transactional. And since there's now no other cleanup of stats, this would lead to stats for slot-less subscriptions to get leaked (however most slot-less subs won't have stats). Additionally, the comment referring to autovacuum cleaning up stats was clearly outdated. Author: Masahiko Sawada <sawada.mshk@gmail.com> Discussion: https://postgr.es/m/CAD21AoAwiby3HeJE7vJe16Gr75RFfJ640dyHqvsiUhyKJTXPtw@mail.gmail.com Backpatch: 15-
* Change internal RelFileNode references to RelFileNumber or RelFileLocator.Robert Haas2022-07-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We have been using the term RelFileNode to refer to either (1) the integer that is used to name the sequence of files for a certain relation within the directory set aside for that tablespace/database combination; or (2) that value plus the OIDs of the tablespace and database; or occasionally (3) the whole series of files created for a relation based on those values. Using the same name for more than one thing is confusing. Replace RelFileNode with RelFileNumber when we're talking about just the single number, i.e. (1) from above, and with RelFileLocator when we're talking about all the things that are needed to locate a relation's files on disk, i.e. (2) from above. In the places where we refer to (3) as a relfilenode, instead refer to "relation storage". Since there is a ton of SQL code in the world that knows about pg_class.relfilenode, don't change the name of that column, or of other SQL-facing things that derive their name from it. On the other hand, do adjust closely-related internal terminology. For example, the structure member names dbNode and spcNode appear to be derived from the fact that the structure itself was called RelFileNode, so change those to dbOid and spcOid. Likewise, various variables with names like rnode and relnode get renamed appropriately, according to how they're being used in context. Hopefully, this is clearer than before. It is also preparation for future patches that intend to widen the relfilenumber fields from its current width of 32 bits. Variables that store a relfilenumber are now declared as type RelFileNumber rather than type Oid; right now, these are the same, but that can now more easily be changed. Dilip Kumar, per an idea from me. Reviewed also by Andres Freund. I fixed some whitespace issues, changed a couple of words in a comment, and made one other minor correction. Discussion: http://postgr.es/m/CA+TgmoamOtXbVAQf9hWFzonUo6bhhjS6toZQd7HZ-pmojtAmag@mail.gmail.com Discussion: http://postgr.es/m/CA+Tgmobp7+7kmi4gkq7Y+4AM9fTvL+O1oQ4-5gFTT+6Ng-dQ=g@mail.gmail.com Discussion: http://postgr.es/m/CAFiTN-vTe79M8uDH1yprOU64MNFE+R3ODRuA+JWf27JbhY4hJw@mail.gmail.com
* Remove LLVM_CONFIG from Makefile.global.inAndres Freund2022-07-06
| | | | | | | LLVM_CONFIG is only used inside configure. Reviewed-By: Peter Eisentraut <peter.eisentraut@enterprisedb.com> Discussion: https://postgr.es/m/0e81e45c-c9a5-e95b-2782-ab2dfec8bf57@enterprisedb.com
* Tiny capitalization adjustment in pkg-config filesPeter Eisentraut2022-07-06
| | | | | This makes the output match that produced by meson (and also matches other packages and pkg-config's own documentation better).
* Remove size increase in ExprEvalStep caused by hashed saopsDavid Rowley2022-07-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 50e17ad28 increased the size of ExprEvalStep from 64 bytes up to 88 bytes. Lots of effort was spent during the development of the current expression evaluation code to make an instance of this struct as small as possible. Making this struct larger than needed reduces CPU cache efficiency during expression evaluation which causes noticeable slowdowns during query execution. In order to reduce the size of the struct, here we remove the fn_addr field. The values from this field can be obtained via fcinfo, just with some extra pointer dereferencing. The extra indirection does not seem to cause any noticeable slowdowns. Various other fields have been moved into the ScalarArrayOpExprHashTable struct. These fields are only used when the ScalarArrayOpExprHashTable pointer has already been dereferenced, so no additional pointer dereferences occur for these. Here we also make hash_fcinfo_data the last field in ScalarArrayOpExprHashTable so that we can avoid a further pointer dereference to get the FunctionCallInfoBaseData. This also saves a call to palloc(). 50e17ad28 was added in 14, but it's too late to adjust the size of the ExprEvalStep in that version, so here we just backpatch to 15, which is currently in beta. Author: Andres Freund, David Rowley Discussion: https://postgr.es/m/20220616233130.rparivafipt6doj3@alap3.anarazel.de Backpatch-through: 15
* Refactor sending of DataRow messages in replication protocolPeter Eisentraut2022-07-06
| | | | | | | | | | | | Some routines open-coded the construction of DataRow messages. Use TupOutputState struct and associated functions instead, which was already done in some places. SendTimeLineHistory() is a bit more complicated and isn't converted by this. Reviewed-by: Nathan Bossart <nathandbossart@gmail.com> Discussion: https://www.postgresql.org/message-id/flat/7e4fdbdc-699c-4cd0-115d-fb78a957fc22@enterprisedb.com
* Unify DLSUFFIX on DarwinPeter Eisentraut2022-07-06
| | | | | | | | | | | | | | | | | macOS has traditionally used extension .dylib for shared libraries (used at build time) and .so for dynamically loaded modules (used by dlopen()). This complicates the build system a bit. Also, Meson uses .dylib for both, so it would be worth unifying this in order to be able to get equal build output. There doesn't appear to be any reason to use any particular extension for dlopened modules, since dlopen() will accept anything and PostgreSQL is well-factored to be able to deal with any extension. Other software packages that I have handy appear to be about 50/50 split on which extension they use for their plugins. So it seems possible to change this safely. Discussion: https://www.postgresql.org/message-id/flat/bcc45f78-e3c3-8fb3-7c42-5371b48b5266%40enterprisedb.com
* Reorder ecpg_config.h.in alphabeticallyPeter Eisentraut2022-07-06
| | | | | This makes it easier to maintain the order if we automate the generation of this file.
* autho_explain: Add GUC to log query parametersMichael Paquier2022-07-06
| | | | | | | | | | | | | auto_explain.log_parameter_max_length is a new GUC part of the extension, similar to the corresponding core setting, that controls the inclusion of query parameters in the logged explain output. More tests are added to check the behavior of this new parameter: when parameters logged in full (the default of -1), when disabled (value of 0) and when partially truncated (value different than the two others). Author: Dagfinn Ilmari Mannsåker Discussion: https://postgr.es/m/87ee09mohb.fsf@wibble.ilmari.org