summaryrefslogtreecommitdiff
path: root/doc/src
Commit message (Collapse)AuthorAgeFilesLines
...
* Remove stray "the".Robert Haas2022-08-291-1/+1
| | | | Per off-list report.
* docs: Fix up some out-of-date references to INHERIT/NOINHERIT.Robert Haas2022-08-292-21/+26
| | | | | | | | | Commit e3ce2de09d814f8770b2e3b3c152b7671bcdb83f should have updated these sections of the documentation, but failed to do so. Patch by me, reviewed by Nathan Bossart. Discussion: http://postgr.es/m/CA+TgmoaKMnde2W_=u7CqeCKi=FKnfbNQPwOR=c_3c8qD7b2nhQ@mail.gmail.com
* Doc: fix example of recursive query.Tom Lane2022-08-281-1/+1
| | | | | | | | Compute total number of sub-parts correctly, per jason@banfelder.net Simon Riggs Discussion: https://postgr.es/m/166161184718.1235920.6304070286124217754@wrigleys.postgresql.org
* Remove configure probe for sockaddr_in6 and require AF_INET6.Thomas Munro2022-08-261-2/+0
| | | | | | | | | | | | | | | | | SUSv3 <netinet/in.h> defines struct sockaddr_in6, and all targeted Unix systems have it. Windows has it in <ws2ipdef.h>. Remove the configure probe, the macro and a small amount of dead code. Also remove a mention of IPv6-less builds from the documentation, since there aren't any. This is similar to commits f5580882 and 077bf2f2 for Unix sockets. Even though AF_INET6 is an "optional" component of SUSv3, there are no known modern operating system without it, and it seems even less likely to be omitted from future systems than AF_UNIX. Reviewed-by: Andres Freund <andres@anarazel.de> Discussion: https://postgr.es/m/CA+hUKGKErNfhmvb_H0UprEmp4LPzGN06yR2_0tYikjzB-2ECMw@mail.gmail.com
* Fix doc oversight for custom WAL resource managers.Jeff Davis2022-08-251-5/+2
| | | | | | Reported-by: Bharath Rupireddy Backpatch-through: 15 Discussion: https://postgr.es/m/CALj2ACU+at7RqnWEzS59QsFg3ZOF4C4GSp7pt+PWiLEp0zrEKg@mail.gmail.com
* Allow grant-level control of role inheritance behavior.Robert Haas2022-08-254-14/+60
| | | | | | | | | | | | | | | | | | | | The GRANT statement can now specify WITH INHERIT TRUE or WITH INHERIT FALSE to control whether the member inherits the granted role's permissions. For symmetry, you can now likewise write WITH ADMIN TRUE or WITH ADMIN FALSE to turn ADMIN OPTION on or off. If a GRANT does not specify WITH INHERIT, the behavior based on whether the member role is marked INHERIT or NOINHERIT. This means that if all roles are marked INHERIT or NOINHERIT before any role grants are performed, the behavior is identical to what we had before; otherwise, it's different, because ALTER ROLE [NO]INHERIT now only changes the default behavior of future grants, and has no effect on existing ones. Patch by me. Reviewed and testing by Nathan Bossart and Tushar Ahuja, with design-level comments from various others. Discussion: http://postgr.es/m/CA+Tgmoa5Sf4PiWrfxA=sGzDKg0Ojo3dADw=wAHOhR9dggV=RmQ@mail.gmail.com
* doc: Fix typo in GRANT docsDaniel Gustafsson2022-08-251-1/+1
| | | | | Commit ce6b672e445 accidentally introduced a trivial typo in the documentation for GRANT.
* Doc: remove duplicate "a" from func.sgmlDavid Rowley2022-08-241-1/+1
| | | | | | Author: Shinya Kato Discussion: https://postgr.es/m/76c01275776749a167f49379ebec57f1@oss.nttdata.com Backpatch-through: 15, where that change was introduced
* Doc: document possible need to raise kernel's somaxconn limit.Tom Lane2022-08-231-0/+16
| | | | | | | | | | | | On fast machines, it's possible for applications such as pgbench to issue connection requests so quickly that the postmaster's listen queue overflows in the kernel, resulting in unexpected failures (with not-very-helpful error messages). Most modern OSes allow the queue size to be increased, so document how to do that. Per report from Kevin McKibbin. Discussion: https://postgr.es/m/CADc_NKg2d+oZY9mg4DdQdoUcGzN2kOYXBu-3--RW_hEe0tUV=g@mail.gmail.com
* Doc: prefer sysctl to /proc/sys in docs and comments.Tom Lane2022-08-231-5/+6
| | | | | | | | | sysctl is more portable than Linux's /proc/sys file tree, and often easier to use too. That's why most of our docs refer to sysctl when talking about how to adjust kernel parameters. Bring the few stragglers into line. Discussion: https://postgr.es/m/361175.1661187463@sss.pgh.pa.us
* Make role grant system more consistent with other privileges.Robert Haas2022-08-223-8/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, membership of role A in role B could be recorded in the catalog tables only once. This meant that a new grant of role A to role B would overwrite the previous grant. For other object types, a new grant of permission on an object - in this case role A - exists along side the existing grant provided that the grantor is different. Either grant can be revoked independently of the other, and permissions remain so long as at least one grant remains. Make role grants work similarly. Previously, when granting membership in a role, the superuser could specify any role whatsoever as the grantor, but for other object types, the grantor of record must be either the owner of the object, or a role that currently has privileges to perform a similar GRANT. Implement the same scheme for role grants, treating the bootstrap superuser as the role owner since roles do not have owners. This means that attempting to revoke a grant, or admin option on a grant, can now fail if there are dependent privileges, and that CASCADE can be used to revoke these. It also means that you can't grant ADMIN OPTION on a role back to a user who granted it directly or indirectly to you, similar to how you can't give WITH GRANT OPTION on a privilege back to a role which granted it directly or indirectly to you. Previously, only the superuser could specify GRANTED BY with a user other than the current user. Relax that rule to allow the grantor to be any role whose privileges the current user posseses. This doesn't improve compatibility with what we do for other object types, where support for GRANTED BY is entirely vestigial, but it makes this feature more usable and seems to make sense to change at the same time we're changing related behaviors. Along the way, fix "ALTER GROUP group_name ADD USER user_name" to require the same privileges as "GRANT group_name TO user_name". Previously, CREATEROLE privileges were sufficient for either, but only the former form was permissible with ADMIN OPTION on the role. Now, either CREATEROLE or ADMIN OPTION on the role suffices for either spelling. Patch by me, reviewed by Stephen Frost. Discussion: http://postgr.es/m/CA+TgmoaFr-RZeQ+WoQ5nKPv97oT9+aDgK_a5+qWHSgbDsMp1Vg@mail.gmail.com
* doc: Minor wordsmithing to COPY docsDaniel Gustafsson2022-08-221-6/+6
| | | | | | | | | | | | Perform some minor wordsmithing on two sentences in the COPY documentation to make them clearer. While there, also ensure to wrap a few occurrences of CSV in <literal> which were missing this. Reported-by: Eric Mutta <eric.mutta@gmail.com> Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://postgr.es/m/166104548566.654.11680826843612576896@wrigleys.postgresql.org
* doc: Improve some markups and some wording around archiving modulesMichael Paquier2022-08-197-29/+31
| | | | | | | | | | | | | This commit adds or fixes markups used in a couple of places in the docs (for <command>, <systemitem> and <literal>). While on it, this clarifies some of the documentation added recently for archiving modules with archive_command, that would still be used as default choice if no external module is defined (though an archive module could as well use an archive_command). Author: Maxim Yablokov Discussion: https://postgr.es/m/b47ec4e8-6f6a-2aba-038e-d5db150b245e@postgrespro.ru Backpatch-through: 15
* Ensure that pg_auth_members.grantor is always valid.Robert Haas2022-08-181-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, "GRANT foo TO bar" or "GRANT foo TO bar GRANTED BY baz" would record the OID of the grantor in pg_auth_members.grantor, but that role could later be dropped without modifying or removing the pg_auth_members record. That's not great, because we typically try to avoid dangling references in catalog data. Now, a role grant depends on the grantor, and the grantor can't be dropped without removing the grant or changing the grantor. "DROP OWNED BY" will remove the grant, just as it does for other kinds of privileges. "REASSIGN OWNED BY" will not, again just like what we do in other cases involving privileges. pg_auth_members now has an OID column, because that is needed in order for dependencies to work. It also now has an index on the grantor column, because otherwise dropping a role would require a sequential scan of the entire table to see whether the role's OID is in use as a grantor. That probably wouldn't be too large a problem in practice, but it seems better to have an index just in case. A follow-on patch is planned with the goal of more thoroughly rationalizing the behavior of role grants. This patch is just trying to do enough to make sure that the data we store in the catalogs is at some basic level valid. Patch by me, reviewed by Stephen Frost Discussion: http://postgr.es/m/CA+TgmoaFr-RZeQ+WoQ5nKPv97oT9+aDgK_a5+qWHSgbDsMp1Vg@mail.gmail.com
* Refer to replication origin roident as "ID" in user facing messages and docsJohn Naylor2022-08-181-2/+2
| | | | | | | | | | | | | | The table column that stores this is of type oid, but is actually limited to uint16 and has a different path for creating new values. Some of the documentation already referred to it as an ID, so let's standardize on that. While at it, most format strings already use %u, so for consintency change the remaining stragglers using %d. Per suggestions from Tom Lane and Justin Pryzby Discussion: https://www.postgresql.org/message-id/3437166.1659620465%40sss.pgh.pa.us Backpatch to v15
* doc: Add a note on PO editorsDaniel Gustafsson2022-08-171-1/+3
| | | | | | | | | | While PO files can be edited in any text editor, specialized tools for translation editing can be quite helpful with automating tasks etc. Add a small note about PO editors to encourage new translators to research which tool works best for them. Reviewed-by: Bruce Momjian <bruce@momjian.us> Discussion: https://postgr.es/m/163490116698.684.10398197970578456928@wrigleys.postgresql.org
* doc: Consistently spell case-insensitiveDaniel Gustafsson2022-08-173-4/+4
| | | | | | | | While almost all occurrences of "case-insensitive{ly}" were spelled with a dash, a few were using "case insensitive{ly}" with a space instead. Fix by changing these to use a dash to be consistent. Discussion: https://postgr.es/m/7657EDEE-5EE2-4AAB-BA95-47B4F71653E1@yesql.se
* doc: Document pg_trgm being case-insensitive by defaultDaniel Gustafsson2022-08-171-0/+2
| | | | | | | | | | | pg_trgm is by default operating case-insensitively but the docs didn't mention that at all. Author: Erik Rijkers <er@xs4all.nl> Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Reviewed-by: Daniel Gustafsson <daniel@yesql.se> Reported-by: marcmaiwald@googlemail.com Discussion: https://postgr.es/m/166064504415.652.12724576876807446945@wrigleys.postgresql.org
* Allow event trigger table_rewrite for ALTER MATERIALIZED VIEWMichael Paquier2022-08-171-1/+1
| | | | | | | | | | | This event can happen when using SET ACCESS METHOD, as the data files of the materialized need a full refresh but this command tag was not updated to reflect that. The documentation is updated to track this behavior. Author: Onder Kalaci Discussion: https://postgr.es/m/CACawEhXwHN3X34FiwoYG8vXR-oyUdrp7qcfRWSzS+NPahS5gSw@mail.gmail.com Backpatch-through: 15
* doc: Remove reference to tty libpq connstring paramDaniel Gustafsson2022-08-161-9/+0
| | | | | | | | | | | The tty connection string parameter was removed in commit 14d9b3760 but the reference to it in the docs was mistakenly kept. Fix by removing it from the libpq documentation. Backpatch through v14 where the parameter was removed. Author: Noriyoshi Shinoda <noriyoshi.shinoda@hpe.com> Discussion: https://postgr.es/m/DM4PR84MB173433216FCC2A3961879000EE6B9@DM4PR84MB1734.NAMPRD84.PROD.OUTLOOK.COM Backpatch-through: 14
* doc: Add missing parenthesis to keycomboDaniel Gustafsson2022-08-161-1/+1
| | | | | | | | The SIGINT keycombo for the pg_waldump stats emission was lacking a closing parenthesis. Backpatch to 15 where this feature was added. Discussion: https://postgr.es/m/EC39E60E-C8B6-4CDF-8BFA-E4D140446B41@yesql.se Backpatch-through: 15
* doc: fix wrong tag used in create sequence manual.Tatsuo Ishii2022-08-161-1/+1
| | | | | | | | | In ref/create_sequence.sgml <literal> tag was used for nextval function name. This should have been <function> tag. Author: Noboru Saito Discussion: https://postgr.es/m/CAAM3qnJTDFFfRf5JHJ4AYrNcqXgMmj0pbH0%2Bvm%3DYva%2BpJyGymA%40mail.gmail.com Backpatch-through: 10
* doc: Add unit to pg_shmem_allocations attributesDaniel Gustafsson2022-08-151-2/+2
| | | | | | | | | | | The unit of size and allocated_size was not documented. Speciyfing the unit is in line with how many other (but not all) system view attributes are documented so fixing by adding the unit which is "bytes". Author: Euler Taveira <euler@eulerto.com> Reviewed-by: Masahiko Sawada <sawada.mshk@gmail.com> Reported-by: coleman.rik@gmail.com Discussion: https://postgr.es/m/166033703458.653.1583077816076994614@wrigleys.postgresql.org
* Remove HAVE_UNIX_SOCKETS.Thomas Munro2022-08-142-6/+5
| | | | | | | | | | | | | | | | | | | | | | | | | Since HAVE_UNIX_SOCKETS is now defined unconditionally, remove the macro and drop a small amount of dead code. The last known systems not to have them (as far as I know at least) were QNX, which we de-supported years ago, and Windows, which now has them. If a new OS ever shows up with the POSIX sockets API but without working AF_UNIX, it'll presumably still be able to compile the code, and fail at runtime with an unsupported address family error. We might want to consider adding a HINT that you should turn off the option to use it if your network stack doesn't support it at that point, but it doesn't seem worth making the relevant code conditional at compile time. Also adjust a couple of places in the docs and comments that referred to builds without Unix-domain sockets, since there aren't any. Windows still gets a special mention in those places, though, because we don't try to use them by default there yet. 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/CA%2BhUKG%2BL_3brvh%3D8e0BW_VfX9h7MtwgN%3DnFHP5o7X2oZucY9dg%40mail.gmail.com
* Remove configure probe for sys/select.h.Thomas Munro2022-08-141-3/+1
| | | | | | | | | <sys/select.h> is in SUSv3 and every targeted Unix system has it. Provide an empty header in src/include/port/win32 so that we can include it unguarded even on Windows. Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://postgr.es/m/CA%2BhUKG%2BL_3brvh%3D8e0BW_VfX9h7MtwgN%3DnFHP5o7X2oZucY9dg%40mail.gmail.com
* doc: add missing role attributes to user management sectionBruce Momjian2022-08-121-0/+33
| | | | | | | | | | Reported-by: Shinya Kato Discussion: https://postgr.es/m/1ecdb1ff78e9b03dfce37e85eaca725a@oss.nttdata.com Author: Shinya Kato Backpatch-through: 10
* doc: add section about heap-only tuples (HOT)Bruce Momjian2022-08-129-11/+86
| | | | | | | | Reported-by: Jonathan S. Katz Discussion: https://postgr.es/m/c59ffbd5-96ac-a5a5-a401-14f627ca1405@postgresql.org Backpatch-through: 11
* doc: warn about security issues around log filesBruce Momjian2022-08-122-1/+30
| | | | | | | | | | Reported-by: Simon Riggs Discussion: https://postgr.es/m/CANP8+jJESuuXYq9Djvf-+tx2vY2OFLmfEuu+UvwHNJ1RT7iJCQ@mail.gmail.com Author: Simon Riggs Backpatch-through: 10
* doc: clarify configuration file for Windows buildsBruce Momjian2022-08-121-1/+1
| | | | | | | | | | The use of file 'config.pl' was not clearly explained. Reported-by: liambowen@gmail.com Discussion: https://postgr.es/m/164246013804.31952.4958087335645367498@wrigleys.postgresql.org Backpatch-through: 10
* doc: document the CREATE INDEX "USING" clauseBruce Momjian2022-08-121-0/+12
| | | | | | | | | | Somehow this was in the syntax but had no description. Reported-by: robertcorrington@gmail.com Discussion: https://postgr.es/m/164228771825.31954.2719791849363756957@wrigleys.postgresql.org Backpatch-through: 10
* doc: clarify CREATE TABLE AS ... IF NOT EXISTSBruce Momjian2022-08-121-3/+2
| | | | | | | | | | Mention that the table is not modified if it already exists. Reported-by: frank_limpert@yahoo.com Discussion: https://postgr.es/m/164441177106.9677.5991676148704507229@wrigleys.postgresql.org Backpatch-through: 10
* doc: improve wal_level docs for the 'minimal' levelBruce Momjian2022-08-121-12/+14
| | | | | | | | | | Reported-by: David G. Johnston Discussion: https://postgr.es/m/CAKFQuwZ24UcfkoyLLSW3PMGQATomOcw1nuYFRuMev-NoOF+mYw@mail.gmail.com Author: David G. Johnston Backpatch-through: 14, partial to 13
* doc: clarify DROP EXTENSION dependent members textBruce Momjian2022-08-121-4/+4
| | | | | | | | | | | | Member tracking was added in PG 13. Reported-by: David G. Johnston Discussion: https://postgr.es/m/CAKFQuwY1YtxQHVWUFYvSnOjZ5VPpXjF33V52bSKEwFjK2K=1Aw@mail.gmail.com Author: David G. Johnston Backpatch-through: 13
* MERGE docs adjustmentsAlvaro Herrera2022-08-122-8/+5
| | | | | | | Per Justin Pryzby Discussion: https://postgr.es/m/20220801145257.GA15006@telsasoft.com Discussion: https://postgr.es/m/20220714162618.GH18011@telsasoft.com
* Improve the protocol message descriptions for 2PC logical replication.Amit Kapila2022-08-101-14/+14
| | | | | | | | | | | | The messages were using 'two-phase transaction' at some places and 'prepared transaction' at other places. Make them consistently use 'prepared transaction'. Reported-by: Ekaterina Kiryanova Author: Peter Smith Reviewed by: Amit Kapila Backpatch-through: 15 Discussion: https://postgr.es/m/745414e7-efb2-a6ae-5b83-fcbdf35aabc8@postgrespro.ru
* doc: mention that COPY MATCH requires columns _in_ _order_Bruce Momjian2022-08-091-1/+1
| | | | | | | | Question asked at SCaLE conference. Reported-by: doc suggestion by Stephen Frost Backpatch-through: 15
* Fix some inconsistencies with GUC categoriesMichael Paquier2022-08-091-0/+7
| | | | | | | | | | | | | | | | | | | | This commit addresses a few things around GUCs: - The TCP-related parameters (the four tcp_keepalives_* and client_connection_check_interval are listed in postgresql.conf.sample in a subsection called "TCP settings" of "CONNECTIONS AND AUTHENTICATION", but they did not have their own group name in guc.c. - enable_group_by_reordering, stats_fetch_consistency and recovery_prefetch had an inconsistent description, missing a dot at the end. - In postgresql.conf.sample, "Process title" should not have a section of its own, but it should be a subsection of "REPORTING AND LOGGING". This impacts the contents of pg_settings, which could be seen as a compatibility break, so no backpatch is done. This is similar to the cleanup done in a55a984. Author: Shinya Kato Discussion: https://postgr.es/m/5e0c9c608624eafbba910c344282cb14@oss.nttdata.com
* In extensions, don't replace objects not belonging to the extension.Tom Lane2022-08-081-11/+0
| | | | | | | | | | | | | | | | | | | | | | | Previously, if an extension script did CREATE OR REPLACE and there was an existing object not belonging to the extension, it would overwrite the object and adopt it into the extension. This is problematic, first because the overwrite is probably unintentional, and second because we didn't change the object's ownership. Thus a hostile user could create an object in advance of an expected CREATE EXTENSION command, and would then have ownership rights on an extension object, which could be modified for trojan-horse-type attacks. Hence, forbid CREATE OR REPLACE of an existing object unless it already belongs to the extension. (Note that we've always forbidden replacing an object that belongs to some other extension; only the behavior for previously-free-standing objects changes here.) For the same reason, also fail CREATE IF NOT EXISTS when there is an existing object that doesn't belong to the extension. Our thanks to Sven Klemm for reporting this problem. Security: CVE-2022-2625
* Be more prescriptive in new doc about re-archiving of same WAL file.Noah Misch2022-08-051-10/+8
| | | | | | Nathan Bossart, reviewed by David Steele. Discussion: https://postgr.es/m/20220731065156.GA3694276@rfd.leadboat.com
* Remove configure probes for symlink/readlink, and dead code.Thomas Munro2022-08-052-11/+0
| | | | | | | | | | | | | | | | | | | symlink() and readlink() are in SUSv2 and all targeted Unix systems have them. We have partial emulation on Windows. Code that raised runtime errors on systems without it has been dead for years, so we can remove that and also references to such systems in the documentation. Define HAVE_READLINK and HAVE_SYMLINK macros on Unix. Our Windows replacement functions based on junction points can't be used for relative paths or for non-directories, so the macros can be used to check for full symlink support. The places that deal with tablespaces can just use symlink functions without checking the macros. (If they did check the macros, they'd need to provide an #else branch with a runtime or compile time error, and it'd be dead code.) Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Reviewed-by: Andres Freund <andres@anarazel.de> Discussion: https://postgr.es/m/CA+hUKGJ3LHeP9w5Fgzdr4G8AnEtJ=z=p6hGDEm4qYGEUX5B6fQ@mail.gmail.com
* Fix assorted doc typosJohn Naylor2022-08-043-4/+4
| | | | | | | | Erik Rijkers and Justin Pryzby Backpatch to v14 Discussion: https://www.postgresql.org/message-id/b79bfeff-d0e3-29a3-2576-0e325848dede%40xs4all.nl
* Clarify DROP EXTENSION docs regarding explicitly dependent routinesJohn Naylor2022-08-041-1/+2
| | | | | | | | Per suggestion from Robert Haas Backpatch to v14 Discussion: https://www.postgresql.org/message-id/CA%2BTgmoZ1QvHquYHLkMy1oHKqz4-E7QQctj6e0ocq_GP1B5%2B9bA%40mail.gmail.com
* Change type "char"'s I/O format for non-ASCII characters.Tom Lane2022-08-021-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | Previously, a byte with the high bit set was just transmitted as-is by charin() and charout(). This is problematic if the database encoding is multibyte, because the result of charout() won't be validly encoded, which breaks various stuff that expects all text strings to be validly encoded. We've previously decided to enforce encoding validity rather than try to individually harden each place that might have a problem with such strings, so it's time to do something about "char". To fix, represent high-bit-set characters as \ooo (backslash and three octal digits), following the ancient "escape" format for bytea. charin() will continue to accept the old way as well, though that is only reachable in single-byte encodings. Add some test cases just so there is coverage for this code. We'll otherwise leave this question undocumented as it was before, because we don't really want to encourage end-user use of "char". For the moment, back-patch into v15 so that this change appears in 15beta3. If there's not great pushback we should consider absorbing this change into the older branches. Discussion: https://postgr.es/m/2318797.1638558730@sss.pgh.pa.us
* doc: Fix typos in protocol.sgmlMichael Paquier2022-08-021-7/+7
| | | | | | Author: Ekaterina Kiryanova Discussion: https://postgr.es/m/745414e7-efb2-a6ae-5b83-fcbdf35aabc8@postgrespro.ru Backpatch-through: 15
* Add --schema and --exclude-schema options to vacuumdb.Andrew Dunstan2022-07-311-0/+66
| | | | | | | | | | | These two new options can be used to either process all tables in specific schemas or to skip processing all tables in specific schemas. This change also refactors the handling of invalid combinations of command-line options to a new helper function. Author: Gilles Darold Reviewed-by: Justin Pryzby, Nathan Bossart and Michael Paquier. Discussion: https://postgr.es/m/929fbf3c-24b8-d454-811f-1d5898ab3e91%40migops.com
* Support pg_read_[binary_]file (filename, missing_ok).Tom Lane2022-07-291-4/+14
| | | | | | | | | | | | | | | | | | There wasn't an especially nice way to read all of a file while passing missing_ok = true. Add an additional overloaded variant to support that use-case. While here, refactor the C code to avoid a rats-nest of PG_NARGS checks, instead handling the argument collection in the outer wrapper functions. It's a bit longer this way, but far more straightforward. (Upon looking at the code coverage report for genfile.c, I was impelled to also add a test case for pg_stat_file() -- tgl) Kyotaro Horiguchi Discussion: https://postgr.es/m/20220607.160520.1984541900138970018.horikyota.ntt@gmail.com
* doc: avoid saying "inheritance" ...Alvaro Herrera2022-07-282-8/+8
| | | | | | | | | | | ... when it applies to partitioned relations. This is almost the opposite of 0c06534bd63b, which removed references to "partition" in favour of "child". Author: Justin Pryzby <pryzby@telsasoft.com> Reviewed-by: Ashutosh Bapat <ashutosh.bapat@enterprisedb.com> Reviewed-by: Amit Langote <amitlangote09@gmail.com> Discussion: https://postgr.es/m/20220525013248.GO19626@telsasoft.com
* Add missing PGDLLEXPORT markings in contrib/pg_prewarm.Tom Lane2022-07-271-5/+6
| | | | | | | | | | | | | | After commit 089480c07, it's necessary for background worker entry points to be marked PGDLLEXPORT, else they aren't findable by LookupBackgroundWorkerFunction(). Since pg_prewarm lacks any regression tests, it's not surprising its worker entry points were overlooked. (A quick search turned up no other such oversights.) I added some documentation pointing out the need for this, too. Robins Tharakan and Tom Lane CAEP4nAzndnQv3-1QKb=D-hLoK3Rko12HHMFHHtdj2GQAUXO3gw@mail.gmail.com
* Remove the restriction that the relmap must be 512 bytes.Robert Haas2022-07-261-2/+2
| | | | | | | | | | | | | Instead of relying on the ability to atomically overwrite the entire relmap file in one shot, write a new one and durably rename it into place. Removing the struct padding and the calculation showing why the map is exactly 512 bytes, and change the maximum number of entries to a nearby round number. Patch by me, reviewed by Andres Freund and Dilip Kumar. Discussion: http://postgr.es/m/CA+TgmoZq5%3DLWDK7kHaUbmWXxcaTuw_QwafgG9dr-BaPym_U8WQ%40mail.gmail.com Discussion: http://postgr.es/m/CAFiTN-ttOXLX75k_WzRo9ar=VvxFhrHi+rJxns997F+yvkm==A@mail.gmail.com
* Force immediate commit after CREATE DATABASE etc in extended protocol.Tom Lane2022-07-261-0/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We have a few commands that "can't run in a transaction block", meaning that if they complete their processing but then we fail to COMMIT, we'll be left with inconsistent on-disk state. However, the existing defenses for this are only watertight for simple query protocol. In extended protocol, we didn't commit until receiving a Sync message. Since the client is allowed to issue another command instead of Sync, we're in trouble if that command fails or is an explicit ROLLBACK. In any case, sitting in an inconsistent state while waiting for a client message that might not come seems pretty risky. This case wasn't reachable via libpq before we introduced pipeline mode, but it's always been an intended aspect of extended query protocol, and likely there are other clients that could reach it before. To fix, set a flag in PreventInTransactionBlock that tells exec_execute_message to force an immediate commit. This seems to be the approach that does least damage to existing working cases while still preventing the undesirable outcomes. While here, add some documentation to protocol.sgml that explicitly says how to use pipelining. That's latent in the existing docs if you know what to look for, but it's better to spell it out; and it provides a place to document this new behavior. Per bug #17434 from Yugo Nagata. It's been wrong for ages, so back-patch to all supported branches. Discussion: https://postgr.es/m/17434-d9f7a064ce2a88a3@postgresql.org