aboutsummaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAge
* Add CHECK_FOR_INTERRUPTS() to the repeat() functionJoe Conway2020-05-28
| | | | | | | | | | | The repeat() function loops for potentially a long time without ever checking for interrupts. This prevents, for example, a query cancel from interrupting until the work is all done. Fix by inserting a CHECK_FOR_INTERRUPTS() into the loop. Backpatch to all supported versions. Discussion: https://www.postgresql.org/message-id/flat/8692553c-7fe8-17d9-cbc1-7cddb758f4c6%40joeconway.com
* Add missing error code to "cannot attach index ..." error.Heikki Linnakangas2020-05-28
| | | | | | | | ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE was used in an ereport with the same message but different errdetail a few lines earlier, so use that here as well. Backpatch-through: 11
* Fix typo in test comment.Heikki Linnakangas2020-05-28
| | | | | The same comment was copied to a few different places, with the same typo. Backpatch down to v11, where this typo was introduced.
* Fix some comments in xlogreader.hMichael Paquier2020-05-28
| | | | | | segment_open and segment_close were mentioned with incorrect names. Discussion: https://postgr.es/m/20200525234944.GA1573@paquier.xyz
* Fix some mentions to memory units in postgresql.conf.sampleMichael Paquier2020-05-28
| | | | | | | | | The default unit for max_slot_wal_keep_size is megabytes. While on it, also change temp_file_limit to use a more consistent wording. Reported-by: Jeff Janes, Fujii Masao Author: Kyotaro Horiguchi Discussion: https://postgr.es/m/CAMkU=1wWZhhjpwRFKJ9waQGxxROeC0P6UqPvb90fAaGz7dhoHA@mail.gmail.com
* Remove some tabs in SQL code in C string literalsPeter Eisentraut2020-05-27
| | | | | This is not handled uniformly throughout the code, but at least nearby code can be consistent.
* Avoid fragmentation of logical tapes when writing concurrently.Jeff Davis2020-05-26
| | | | | | | | | | Disk-based HashAgg relies on writing to multiple tapes concurrently. Avoid fragmentation of the tapes' blocks by preallocating many blocks for a tape at once. No file operations are performed during preallocation; only the block numbers are reserved. Reviewed-by: Tomas Vondra Discussion: https://postgr.es/m/20200519151202.u2p2gpiawoaznsv2%40development
* Message wording tweaksPeter Eisentraut2020-05-26
| | | | | Make the wording of new libpq messages more similar to existing messages in the backend.
* Add lcov exclusion markers to jsonpath scannerPeter Eisentraut2020-05-26
| | | | | This was done for all scanners in 421167362242ce1fb46d6d720798787e7cd65aad but not added to the new one.
* gss: add missing references to hostgssenc and hostnogssencBruce Momjian2020-05-25
| | | | | | | | | | | | | These were missed when these were added to pg_hba.conf in PG 12; updates docs and pg_hba.conf.sample. Reported-by: Arthur Nascimento Bug: 16380 Discussion: https://postgr.es/m/20200421182736.GG19613@momjian.us Backpatch-through: 12
* Reconcile nodes/*funcs.c.Noah Misch2020-05-25
| | | | | The stmt_len changes do not affect behavior. LimitPath has no other support functions, so that part changes only debugging output.
* Add missing invocations to object access hooksMichael Paquier2020-05-23
| | | | | | | | | | | | | | | The following commands have been missing calls to object access hooks InvokeObjectPost{Create|Alter}Hook normally applied to all commands: - ALTER RULE RENAME TO - ALTER USER MAPPING - CREATE ACCESS METHOD - CREATE STATISTICS Thanks also to Robert Haas for the discussion. Author: Mark Dilger Reviewed-by: Álvaro Herrera, Michael Paquier Discussion: https://postgr.es/m/435CD295-F409-44E0-91EC-DF32C7AFCD76@enterprisedb.com
* Fix two typos in a commentAlvaro Herrera2020-05-22
| | | | They were introduced in 898e5e3290a7; backpatch to 12.
* Remove unnecessary castPeter Eisentraut2020-05-22
| | | | | Probably copied from nearby calls where it is necessary. But this one also casts away constness, so it was doubly annoying.
* Adjust indentation in src/backend/optimizer/README.Etsuro Fujita2020-05-22
| | | | | | | | | | The previous indentation of optimizer functions was unclear; adjust the indentation dashes so that a deeper level of indentation indicates that the outer optimizer function calls the inner one. Author: Richard Guo, with additional change by me Reviewed-by: Kyotaro Horiguchi Discussion: https://postgr.es/m/CAMbWs4-U-ogzpchGsP2BBMufCss1hktm%2B%2BeTJK_dUC196pw0cQ%40mail.gmail.com
* Clear some style deviations.Noah Misch2020-05-21
|
* Use explicit_bzero() when clearing sslpassword in libpqMichael Paquier2020-05-21
| | | | | | | | | Since 74a308c, any security-sensitive information gets cleared from memory this way. This was forgotten in 4dc6355. Author: Daniel Gustafsson Reviewed-by: Peter Eisentraut, Michael Paquier Discussion: https://postgr.es/m/935443BA-D42E-4CE0-B181-1AD79E6DD45A@yesql.se
* Fix MSVC installations with multiple "configure" files detectedMichael Paquier2020-05-21
| | | | | | | | | | | | | | | | When installing binaries and libraries using the MSVC installation routines, the operation gets done after moving to the root folder, whose location is detected by checking if "configure" exists two times in a row. So, calling the installation script from src/tools/msvc/ with an extra "configure" file four levels up the root path of the code tree causes the execution to go further up, leading to a failure in finding the builds. This commit fixes the issue by moving to the root folder of the code tree only once, when necessary. Author: Arnold Müller Reviewed-by: Daniel Gustafsson Discussion: https://postgr.es/m/16343-f638f67e7e52b86c@postgresql.org Backpatch-through: 9.5
* part_strategy does not need its very own keyword classification.Tom Lane2020-05-19
| | | | | | | This should be plain old ColId. Making it so makes the grammar less complicated, and makes the compiled tables a kilobyte or so smaller (likely because they don't have to deal with a keyword classification that's not used anyplace else).
* Reconsider nbtree page deletion assertion.Peter Geoghegan2020-05-19
| | | | | | | | | | | | | | | | Commit 624686abcf8 added an assertion that verified that _bt_search successfully relocated the leaf page undergoing deletion. Page deletion cannot deal with the case where the descent stack is to the right of the page, so this seemed critical (deletion can only handle the case where the descent stack is to the left of the leaf/target page). However, the assertion went a bit too far. Since only a buffer pin is held on the leaf page throughout the call to _bt_search, nothing guarantees that it can't have split during this small window. And if does actually split, _bt_search may end up "relocating" a page to the right of the original target leaf page. This scenario seems extremely unlikely, but it must still be considered. Remove the assertion, and document how we cope in this scenario.
* WITH TIES: number of rows is optional and defaults to oneAlvaro Herrera2020-05-18
| | | | | | | | FETCH FIRST .. ONLY implements this correctly, but we missed to include it for FETCH FIRST .. WITH TIES in commit 357889eb17bb. Author: Vik Fearing Discussion: https://postgr.es/m/6aa690ef-551d-e24f-2690-c38c2442947c@postgresfriends.org
* Remove unused variables.Tom Lane2020-05-18
| | | | | | | | | g_comment_start and g_comment_end have been unused since commit 30ab5bd43d8f2082659191de8ae19be98c960ad7. Daniel Gustafsson Discussion: https://postgr.es/m/2CA1BA9F-CDF9-41BE-96A1-2EFD2A3EA6CA@yesql.se
* Translation updatesPeter Eisentraut2020-05-18
| | | | | Source-Git-URL: https://git.postgresql.org/git/pgtranslation/messages.git Source-Git-Hash: 031ca65d7825c3e539a3e62ea9d6630af12e6b6b
* Fix typos in READMEMagnus Hagander2020-05-18
| | | | Author: Daniel Gustafsson
* Fix comment in slot.c.Amit Kapila2020-05-18
| | | | | | | | Reported-by: Sawada Masahiko Author: Sawada Masahiko Reviewed-by: Amit Kapila Backpatch-through: 9.5 Discussion: https://postgr.es/m/CA+fd4k4Ws7M7YQ8PqSym5WB1y75dZeBTd1sZJUQdfe0KJQ-iSA@mail.gmail.com
* Cosmetic improvement for psql opfamily-related informationAlexander Korotkov2020-05-17
| | | | | * Rename column "Opfamily Name" to "Operator family" for uniformity. * Rename column alias from "t1" to "t".
* Fix translate_columns[] arrays in opfamily-related psql functionsAlexander Korotkov2020-05-17
| | | | | | | Make number of translate_columns elements match the number of output columns. The only "true" value, which was previously specified, seems to be intended for opfamily operator "purpose" column. But that column has already translated values substituted. So, all elements in translate_columns[] should be "false".
* Improve ordering for \dAo and \dAp psql commandsAlexander Korotkov2020-05-17
| | | | | | | | | | | | | | | This commit changes ORDER BY clause for \dAo and \dAp psql commands in the following way. * Operators for the same types are grouped together. * Same-class operators and procedures are listed before cross-class operators and procedures. Modification of ORDER BY clause for \dAp required removing DISTINCT clause, which doesn't seem to affect anything. Discussion: https://postgr.es/m/20200511210856.GA18368%40alvherre.pgsql Author: Alvaro Herrera revised by me Reviewed-by: Alexander Korotkov, Nikita Glukhov
* Mop-up for wait event naming issues.Tom Lane2020-05-16
| | | | | | | | | | | | Synchronize the event names for parallel hash join waits with other event names, by getting rid of the slashes and dropping "-ing" suffixes. Rename ClogGroupUpdate to XactGroupUpdate, to match the new SLRU name. Move the ProcSignalBarrier event to the IPC category; it doesn't belong under IO. Also a bit more wordsmithing in the wait event documentation tables. Discussion: https://postgr.es/m/4505.1589640417@sss.pgh.pa.us
* Make pg_stat_wal_receiver consistent with the WAL receiver's shmem infoMichael Paquier2020-05-17
| | | | | | | | | | | | | d140f2f3 has renamed receivedUpto to flushedUpto, and has added writtenUpto to the WAL receiver's shared memory information, but pg_stat_wal_receiver was not consistent with that. This commit renames received_lsn to flushed_lsn, and adds a new column called written_lsn. Bump catalog version. Author: Michael Paquier Reviewed-by: Álvaro Herrera Discussion: https://postgr.es/m/20200515090817.GA212736@paquier.xyz
* Fix bugs in OpenSSL hook renaming.Tom Lane2020-05-16
| | | | | | | | | | libpq's exports.txt was overlooked in commit 36d108761, which the buildfarm is quite unhappy about. Also, I'd gathered that the plan included renaming PQgetSSLKeyPassHook to PQgetSSLKeyPassHook_OpenSSL, but that didn't happen in the patch as committed. I'm taking it on my own authority to do so now, since the window before beta1 is closing fast.
* Rename PQsetSSLKeyPassHook and friendsAndrew Dunstan2020-05-16
| | | | | | | | | | | | | 4dc6355210 provided a way for libraries and clients to modify how libpq handles client certificate passphrases, by installing a hook. However, these routines are quite specific to how OpenSSL works, so it's misleading and not future-proof to have these names not refer to OpenSSL. Change all the names to add "_OpenSSL" after "Hook", and fix the docs accordingly. Author: Daniel Gustafsson Discussion: https://postgr.es/m/981DE552-E399-45C2-9F60-3F0E3770CC61@yesql.se
* Run pgindent with new pg_bsd_indent version 2.1.1.Tom Lane2020-05-16
| | | | | | | | | | | Thomas Munro fixed a longstanding annoyance in pg_bsd_indent, that it would misformat lines containing IsA() macros on the assumption that the IsA() call should be treated like a cast. This improves some other cases involving field/variable names that match typedefs, too. The only places that get worse are a couple of uses of the OpenSSL macro STACK_OF(); we'll gladly take that trade-off. Discussion: https://postgr.es/m/20200114221814.GA19630@alvherre.pgsql
* Final pgindent run with pg_bsd_indent version 2.1.Tom Lane2020-05-16
| | | | | | | This is just to provide a clean basis for comparison of the results of the new version. I did fix a typo that crept into 242dfcbaf. Discussion: https://postgr.es/m/20200114221814.GA19630@alvherre.pgsql
* Fix assertion with relation using REPLICA IDENTITY FULL in subscriberMichael Paquier2020-05-16
| | | | | | | | | | | | | | | | In a logical replication subscriber, a table using REPLICA IDENTITY FULL which has a primary key would try to use the primary key's index available to scan for a tuple, but an assertion only assumed as correct the case of an index associated to REPLICA IDENTITY USING INDEX. This commit corrects the assertion so as the use of a primary key index is a valid case. Reported-by: Dilip Kumar Analyzed-by: Dilip Kumar Author: Euler Taveira Reviewed-by: Michael Paquier, Masahiko Sawada Discussion: https://postgr.es/m/CAFiTN-u64S5bUiPL1q5kwpHNd0hRnf1OE-bzxNiOs5zo84i51w@mail.gmail.com Backpatch-through: 10
* Change locktype "speculative token" to "spectoken".Tom Lane2020-05-15
| | | | | | | | | | | | | | | It's just weird that this name wasn't chosen to look like an identifier. The suspicion that it wasn't thought about too hard is reinforced by the fact that it wasn't documented in the pg_locks view (until I did so, a day or two back). Update, and add a comment reminding future adjusters of this array to fix the docs too. Do some desultory wordsmithing on various entries in the wait events tables. Discussion: https://postgr.es/m/24595.1589326879@sss.pgh.pa.us
* Fix walsender error cleanup codeAlvaro Herrera2020-05-15
| | | | | | | | | | | | | | | In commit 850196b610d2 I (Álvaro) failed to handle the case of walsender shutting down on an error before setting up its 'xlogreader' pointer; the error handling code dereferences the pointer, causing a crash. Fix by testing the pointer before trying to dereference it. Kyotaro authored the code fix; I adopted Nathan's test case to be used by the TAP tests and added the necessary PostgresNode change. Reported-by: Nathan Bossart <bossartn@amazon.com> Author: Kyotaro Horiguchi <horikyota.ntt@gmail.com> Author: Álvaro Herrera <alvherre@alvh.no-ip.org> Discussion: https://postgr.es/m/C04FC24E-903D-4423-B312-6910E4D846E5@amazon.com
* Drop the redundant "Lock" suffix from LWLock wait event names.Tom Lane2020-05-15
| | | | | | | | | | | | This was mostly confusing, especially since some wait events in this class had the suffix and some did not. While at it, stop exposing MainLWLockNames[] as a globally visible name; any code using that directly is almost certainly wrong, as its name has been misleading for some time. (GetLWLockIdentifier() is what to use instead.) Discussion: https://postgr.es/m/28683.1589405363@sss.pgh.pa.us
* Fix bogus initialization of replication origin shared memory state.Tom Lane2020-05-15
| | | | | | | | | | | | | | | | | The previous coding zeroed out offsetof(ReplicationStateCtl, states) more bytes than it was entitled to, as a consequence of starting the zeroing from the wrong pointer (or, if you prefer, using the wrong calculation of how much to zero). It's unsurprising that this has not caused any reported problems, since it can be expected that the newly-allocated block is at the end of what we've used in shared memory, and we always make the shmem block substantially bigger than minimally necessary. Nonetheless, this is wrong and it could bite us someday; plus it's a dangerous model for somebody to copy. This dates back to the introduction of this code (commit 5aa235042), so back-patch to all supported branches.
* Rename assorted LWLock tranches.Tom Lane2020-05-15
| | | | | | | | | | | | | | | | Choose names that fit into the conventions for wait event names (particularly, that multi-word names are in the style MultiWordName) and hopefully convey more information to non-hacker users than the previous names did. Also rename SerializablePredicateLockListLock to SerializablePredicateListLock; the old name was long enough to cause table formatting problems, plus the double occurrence of "Lock" seems confusing/error-prone. Also change a couple of particularly opaque LWLock field names. Discussion: https://postgr.es/m/28683.1589405363@sss.pgh.pa.us
* Add comments linking pg_strftime to timestamptz_to_strAlvaro Herrera2020-05-15
|
* Avoid killing btree items that are already deadAlvaro Herrera2020-05-15
| | | | | | | | | | | | | | | | | | | | | | _bt_killitems marks btree items dead when a scan leaves the page where they live, but it does so with only share lock (to improve concurrency). This was historicall okay, since killing a dead item has no consequences. However, with the advent of data checksums and wal_log_hints, this action incurs a WAL full-page-image record of the page. Multiple concurrent processes would write the same page several times, leading to WAL bloat. The probability of this happening can be reduced by only killing items if they're not already dead, so change the code to do that. The problem could eliminated completely by having _bt_killitems upgrade to exclusive lock upon seeing a killable item, but that would reduce concurrency so it's considered a cure worse than the disease. Backpatch all the way back to 9.5, since wal_log_hints was introduced in 9.4. Author: Masahiko Sawada <masahiko.sawada@2ndquadrant.com> Discussion: https://postgr.es/m/CA+fd4k6PeRj2CkzapWNrERkja5G0-6D-YQiKfbukJV+qZGFZ_Q@mail.gmail.com
* Rename SLRU structures and associated LWLocks.Tom Lane2020-05-15
| | | | | | | | | | | | | | | | | | | | | | | | | | Originally, the names assigned to SLRUs had no purpose other than being shmem lookup keys, so not a lot of thought went into them. As of v13, though, we're exposing them in the pg_stat_slru view and the pg_stat_reset_slru function, so it seems advisable to take a bit more care. Rename them to names based on the associated on-disk storage directories (which fortunately we *did* think about, to some extent; since those are also visible to DBAs, consistency seems like a good thing). Also rename the associated LWLocks, since those names are likewise user-exposed now as wait event names. For the most part I only touched symbols used in the respective modules' SimpleLruInit() calls, not the names of other related objects. This renaming could have been taken further, and maybe someday we will do so. But for now it seems undesirable to change the names of any globally visible functions or structs, so some inconsistency is unavoidable. (But I *did* terminate "oldserxid" with prejudice, as I found that name both unreadable and not descriptive of the SLRU's contents.) Table 27.12 needs re-alphabetization now, but I'll leave that till after the other LWLock renamings I have in mind. Discussion: https://postgr.es/m/28683.1589405363@sss.pgh.pa.us
* Make COPY TO keep locks until the transaction end.Amit Kapila2020-05-15
| | | | | | | | | | | | | | | | | | COPY TO released the ACCESS SHARE lock immediately when it was done rather than holding on to it until the end of the transaction. This breaks the case where a REPEATABLE READ transaction could see an empty table if it repeats a COPY statement and somebody truncated the table in the meantime. Before 4dded12faad the lock was also released after COPY FROM, but the commit failed to notice the irregularity in COPY TO. This is old behavior but doesn't seem important enough to backpatch. Author: Laurenz Albe, based on suggestion by Robert Haas and Tom Lane Reviewed-by: Amit Kapila Discussion: https://postgr.es/m/7bcfc39d4176faf85ab317d0c26786953646a411.camel@cybertec.at
* Remove duplicated comment block in event_trigger.cMichael Paquier2020-05-15
| | | | | | | | | | | The reasons why event triggers are disabled in standalone mode are documented in the code path of ddl_command_start, and other places checking if standalone mode is enabled or not mention to refer to the comment for ddl_command_start, except for table_rewrite that duplicated the same explanation. Reported-by: David G. Johnston Discussion: https://postgr.es/m/CAKFQuwYqHtXpvr2mBJRwH9f+Y5y1GXw3rhbaAu0Dk2MoNevsmA@mail.gmail.com
* Initial pgindent and pgperltidy run for v13.Tom Lane2020-05-14
| | | | | | | | | | | Includes some manual cleanup of places that pgindent messed up, most of which weren't per project style anyway. Notably, it seems some people didn't absorb the style rules of commit c9d297751, because there were a bunch of new occurrences of function calls with a newline just after the left paren, all with faulty expectations about how the rest of the call would get indented.
* Collect built-in LWLock tranche names statically, not dynamically.Tom Lane2020-05-14
| | | | | | | | | | | | | | | | | | There is little point in using the LWLockRegisterTranche mechanism for built-in tranche names. It wastes cycles, it creates opportunities for bugs (since failing to register a tranche name is a very hard-to-detect problem), and the lack of any centralized list of names encourages sloppy nonconformity in name choices. Moreover, since we have a centralized list of the tranches anyway in enum BuiltinTrancheIds, we're certainly not buying any flexibility in return for these disadvantages. Hence, nuke all the backend-internal LWLockRegisterTranche calls, and instead provide a const array of the builtin tranche names. (I have in mind to change a bunch of these names shortly, but this patch is just about getting them into one place.) Discussion: https://postgr.es/m/9056.1589419765@sss.pgh.pa.us
* Fix typo in comment on OpenSSL PEM password callback type name.Heikki Linnakangas2020-05-14
| | | | | | | The type is called "pem_password_cb", not "pem_passwd_cb". Author: Daniel Gustafsson Discussion: https://www.postgresql.org/message-id/22108CF6-228B-45CF-9CDA-5C5F658DCC22@yesql.se
* Move check for fsync=off so that pendingOps still gets cleared.Heikki Linnakangas2020-05-14
| | | | | | | | | | | | Commit 3eb77eba5a moved the loop and refactored it, and inadvertently changed the effect of fsync=off so that it also skipped removing entries from the pendingOps table. That was not intentional, and leads to an assertion failure if you turn fsync on while the server is running and reload the config. Backpatch-through: 12- Reviewed-By: Thomas Munro Discussion: https://www.postgresql.org/message-id/3cbc7f4b-a5fa-56e9-9591-c886deb07513%40iki.fi
* Fix the MSVC build for versions 2015 and later.Amit Kapila2020-05-14
| | | | | | | | | | | | | | | | | | | Visual Studio 2015 and later versions should still be able to do the same as Visual Studio 2012, but the declaration of locale_name is missing in _locale_t, causing the code compilation to fail, hence this falls back instead on to enumerating all system locales by using EnumSystemLocalesEx to find the required locale name.  If the input argument is in Unix-style then we can get ISO Locale name directly by using GetLocaleInfoEx() with LCType as LOCALE_SNAME. In passing, change the documentation references of the now obsolete links. Note that this problem occurs only with NLS enabled builds. Author: Juan José Santamaría Flecha, Davinder Singh and Amit Kapila Reviewed-by: Ranier Vilela and Amit Kapila Backpatch-through: 9.5 Discussion: https://postgr.es/m/CAHzhFSFoJEWezR96um4-rg5W6m2Rj9Ud2CNZvV4NWc9tXV7aXQ@mail.gmail.com