summaryrefslogtreecommitdiff
path: root/doc/src
AgeCommit message (Collapse)Author
13 daysdoc: Fix style of description for pg_buffercache_numa.os_page_numMichael Paquier
Extracted from a larger patch by the same author. Author: Bertrand Drouvot <bertranddrouvot.pg@gmail.com> Discussion: https://postgr.es/m/Z/fFA2heH6lpSLlt@ip-10-97-1-34.eu-west-3.compute.internal
13 daysRename two columns in pg_stat_subscription_stats.Amit Kapila
This patch renames the sync_error_count column to sync_table_error_count in the pg_stat_subscription_stats view. The new name makes the purpose explicit now that a separate column exists to track sequence synchronization errors. Additionally, the column seq_sync_error_count is renamed to sync_seq_error_count to maintain a consistent naming pattern, making it easier for users to group, and query synchronization related counters. Author: Vignesh C <vignesh21@gmail.com> Reviewed-by: Peter Smith <smithpb2250@gmail.com> Reviewed-by: Chao Li <li.evan.chao@gmail.com> Discussion: https://postgr.es/m/CALDaNm3WwJmz=-4ybTkhniB-Nf3qmFG9Zx1uKjyLLoPF5NYYXA@mail.gmail.com
13 daysDoc: Use <structfield> markup for sequence fields.Amit Kapila
Following commit 980a855c5c, update documentation to use <structfield> for sequence columns. Previously, these were incorrectly marked up as <literal>. Author: Peter Smith <smithpb2250@gmail.com> Reviewed-by: Chao Li <li.evan.chao@gmail.com> Discussion: https://postgr.es/m/CAHut+PtpDMUE3Kd1p=1ff9pw2HMbgQCpowE_0Hd6gs5v2pKfQg@mail.gmail.com
13 daysdoc: clarify that pg_upgrade preserves "optimizer" stats.Bruce Momjian
Reported-by: Rambabu V Author: Robert Treat Discussion: https://postgr.es/m/CADtiZxrUzRRX6edyN2y-7U5HA8KSXttee7K=EFTLXjwG1SCE4A@mail.gmail.com Backpatch-through: 18
13 daysdoc: Document default values for some pg_recvlogical options.Fujii Masao
The documentation did not previously mention the default values for the --fsync-interval and --plugin options, even though pg_recvlogical --help shows them. This omission made it harder for users to understand the tool's behavior from the documentation alone. This commit adds the missing default value descriptions for both options to the pg_recvlogical documentation. Author: Fujii Masao <masao.fujii@gmail.com> Reviewed-by: Laurenz Albe <laurenz.albe@cybertec.at> Discussion: https://postgr.es/m/CAHGQGwFqssPBjkWMFofGq32e_tANOeWN-cM=6biAP3nnFUXMRw@mail.gmail.com
14 daysRework output format of pg_dependenciesMichael Paquier
The existing format of pg_dependencies uses a single-object JSON structure, with each key value embedding all the knowledge about the set attributes tracked, like: {"1 => 5": 1.000000, "5 => 1": 0.423130} While this is a very compact format, it is confusing to read and it is difficult to manipulate the values within the object, particularly when tracking multiple attributes. The new output format introduced in this commit is a JSON array of objects, with: - A key named "degree", with a float value. - A key named "attributes", with an array of attribute numbers. - A key named "dependency", with an attribute number. The values use the same underlying type as previously when printed, with a new output format that shows now as follows: [{"degree": 1.000000, "attributes": [1], "dependency": 5}, {"degree": 0.423130, "attributes": [5], "dependency": 1}] This new format will become handy for a follow-up set of changes, so as it becomes possible to inject extended statistics rather than require an ANALYZE, like in a dump/restore sequence or after pg_upgrade on a new cluster. This format has been suggested by Tomas Vondra. The key names are defined in the header introduced by 1f927cce4498, to ease the integration of frontend-specific changes that are still under discussion. (Again a personal note: if anybody comes up with better name for the keys, of course feel free.) The bulk of the changes come from the regression tests, where jsonb_pretty() is now used to make the outputs generated easier to parse. Author: Corey Huinker <corey.huinker@gmail.com> Reviewed-by: Jian He <jian.universality@gmail.com> Reviewed-by: Michael Paquier <michael@paquier.xyz> Discussion: https://postgr.es/m/CADkLM=dpz3KFnqP-dgJ-zvRvtjsa8UZv8wDAQdqho=qN3kX0Zg@mail.gmail.com
14 daysRework output format of pg_ndistinctMichael Paquier
The existing format of pg_ndistinct uses a single-object JSON structure where each key is itself a comma-separated list of attnums, like: {"3, 4": 11, "3, 6": 11, "4, 6": 11, "3, 4, 6": 11} While this is a very compact format, it is confusing to read and it is difficult to manipulate the values within the object. The new output format introduced in this commit is an array of objects, with: - A key named "attributes", that contains an array of attribute numbers. - A key named "ndistinct", represented as an integer. The values use the same underlying type as previously when printed, with a new output format that shows now as follows: [{"ndistinct": 11, "attributes": [3,4]}, {"ndistinct": 11, "attributes": [3,6]}, {"ndistinct": 11, "attributes": [4,6]}, {"ndistinct": 11, "attributes": [3,4,6]}] This new format will become handy for a follow-up set of changes, so as it becomes possible to inject extended statistics rather than require an ANALYZE, like in a dump/restore sequence or after pg_upgrade on a new cluster. This format has been suggested by Tomas Vondra. The key names are defined in a new header, to ease with the integration of frontend-specific changes that are still under discussion. (Personal note: I am not specifically wedded to these key names, but if there are better name suggestions for this release, feel free.) The bulk of the changes come from the regression tests, where jsonb_pretty() is now used to make the outputs generated easier to parse. Author: Corey Huinker <corey.huinker@gmail.com> Reviewed-by: Jian He <jian.universality@gmail.com> Reviewed-by: Michael Paquier <michael@paquier.xyz> Discussion: https://postgr.es/m/CADkLM=dpz3KFnqP-dgJ-zvRvtjsa8UZv8wDAQdqho=qN3kX0Zg@mail.gmail.com
2025-11-17Doc: include MERGE in variable substitution command listDavid Rowley
Backpatch to 15, where MERGE was introduced. Reported-by: <emorgunov@mail.ru> Author: David Rowley <dgrowleyml@gmail.com> Discussion: https://postgr.es/m/176278494385.770.15550176063450771532@wrigleys.postgresql.org Backpatch-through: 15
2025-11-14doc: clarify that logical slots track transaction activityBruce Momjian
Previously it only mentioned WAL retention. Discussion: https://postgr.es/m/pexmenhqptw5h4ma4qasz3cvjtynivxprqifgghdjtmkxdig2g@djg7bk2p6pts Backpatch-through: master
2025-11-14doc: double-quote use of %f, %p, and %r in literal commands.Bruce Momjian
Path expansion might expose characters like spaces which would cause command failure, so double-quote the examples. While %f doesn't need quoting since it uses a fixed character set, it is best to be consistent. Discussion: https://postgr.es/m/aROPCQCfvKp9Htk4@momjian.us Backpatch-through: master
2025-11-14doc: remove verbiage about "receiving" data from rep. slotsBruce Momjian
The slots are just LSN markers, not something to receive from. Backpatch-through: master
2025-11-14Doc: add IDs to copy.sgml's <varlistentry> and <refsect1>Álvaro Herrera
In the spirit of commit 78ee60ed84bb. Author: jian he <jian.universality@gmail.com> Discussion: https://postgr.es/m/CACJufxFsPXCwSVR+_vScZ3bysh4-dpE19iVyeta30uNHwnwnSw@mail.gmail.com
2025-11-14Revert "Drop unnamed portal immediately after execution to completion"Michael Paquier
This reverts commit 1fd981f05369, based on concerns that the logging improvements do not justify the protocol breakage of dropping an unnamed portal once its execution has completed. It seems unlikely that one would try to send an execute or describe message after the portal has been used, but if they do such post-completion messages would not be able to process as the previous versions. Let's revert this change for now so as we keep compatibility and consider a different solution. The tests added by 76bba033128a track the pre-1fd981f05369 behavior, and are still valid. Discussion: https://postgr.es/m/CA+TgmoYFJyJNQw3RT7veO3M2BWRE9Aw4hprC5rOcawHZti-f8g@mail.gmail.com
2025-11-13doc: adjust "Replication Slot" to mention physical & logicalBruce Momjian
Much of the "Replication Slot" chapter applies to physical and logical slots, but it was sloppy in mentioning mostly physical slots. This patch clarified which parts of the text apply to which slot types. This chapter is referenced from the logical slot/subscriber chapter, so it needs to do double duty. Backpatch-through: master
2025-11-13doc: clarify "logical" replication slotsBruce Momjian
Also mention that logical replication slots are created by default when subscriptions are created. This should clarify the text. Backpatch-through: master
2025-11-13doc: clarify "physical" replication slot creation on the primaryBruce Momjian
Previously it was not clear that "physical" replication slots were being discussed, and that they needed to be created on the primary and not the standby. Backpatch-through: master
2025-11-13doc: reorder logical replication benefits in a logical orderBruce Momjian
The previous ordering was hard to understand and remember. Also adjust wording to be more consistent with surrounding items. Backpatch-through: master
2025-11-13doc: Improve description of RLS policies applied by command type.Dean Rasheed
On the CREATE POLICY page, the "Policies Applied by Command Type" table was missing MERGE ... THEN DELETE and some of the policies applied during INSERT ... ON CONFLICT and MERGE. Fix that, and try to improve readability by listing the various MERGE cases separately, rather than together with INSERT/UPDATE/DELETE. Mention COPY ... TO along with SELECT, since it behaves in the same way. In addition, document which policy violations cause errors to be thrown, and which just cause rows to be silently ignored. Also, a paragraph above the table states that INSERT ... ON CONFLICT DO UPDATE only checks the WITH CHECK expressions of INSERT policies for rows appended to the relation by the INSERT path, which is incorrect -- all rows proposed for insertion are checked, regardless of whether they end up being inserted. Fix that, and also mention that the same applies to INSERT ... ON CONFLICT DO NOTHING. In addition, in various other places on that page, clarify how the different types of policy are applied to different commands, and whether or not errors are thrown when policy checks do not pass. Backpatch to all supported versions. Prior to v17, MERGE did not support RETURNING, and so MERGE ... THEN INSERT would never check new rows against SELECT policies. Prior to v15, MERGE was not supported at all. Author: Dean Rasheed <dean.a.rasheed@gmail.com> Reviewed-by: Viktor Holmberg <v@viktorh.net> Reviewed-by: Jian He <jian.universality@gmail.com> Discussion: https://postgr.es/m/CAEZATCWqnfeChjK=n1V_dYZT4rt4mnq+ybf9c0qXDYTVMsy8pg@mail.gmail.com Backpatch-through: 14
2025-11-12doc: Document effects of ownership change on privilegesDaniel Gustafsson
Explicitly document that privileges are transferred along with the ownership. Backpatch to all supported versions since this behavior has always been present. Author: Laurenz Albe <laurenz.albe@cybertec.at> Reviewed-by: Daniel Gustafsson <daniel@yesql.se> Reviewed-by: David G. Johnston <david.g.johnston@gmail.com> Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Reviewed-by: Josef Šimánek <josef.simanek@gmail.com> Reported-by: Gilles Parc <gparc@free.fr> Discussion: https://postgr.es/m/2023185982.281851219.1646733038464.JavaMail.root@zimbra15-e2.priv.proxad.net Backpatch-through: 14
2025-11-12Doc: Add documentation for sequence synchronization.Amit Kapila
Add documentation describing sequence synchronization support in logical replication. It explains how sequence changes are synchronized from the publisher to the subscriber, the configuration requirements, and provide examples illustrating setup and usage. Additionally, document the pg_get_sequence_data() function, which allows users to query sequence details on the publisher to determine when to refresh corresponding sequences on the subscriber. Author: Vignesh C <vignesh21@gmail.com> Reviewed-by: Peter Smith <smithpb2250@gmail.com> Reviewed-by: shveta malik <shveta.malik@gmail.com> Reviewed-by: Chao Li <li.evan.chao@gmail.com> Reviewed-by: Amit Kapila <amit.kapila16@gmail.com> Discussion: https://postgr.es/m/CAA4eK1LC+KJiAkSrpE_NwvNdidw9F2os7GERUeSxSKv71gXysQ@mail.gmail.com
2025-11-12doc: Fix incorrect synopsis for ALTER PUBLICATION ... DROP ...Fujii Masao
The synopsis for the ALTER PUBLICATION ... DROP ... command incorrectly implied that a column list and WHERE clause could be specified as part of the publication object. However, these options are not allowed for DROP operations, making the documentation misleading. This commit corrects the synopsis to clearly show only the valid forms of publication objects. Backpatched to v15, where the incorrect synopsis was introduced. Author: Peter Smith <smithpb2250@gmail.com> Reviewed-by: Fujii Masao <masao.fujii@gmail.com> Discussion: https://postgr.es/m/CAHut+PsPu+47Q7b0o6h1r-qSt90U3zgbAHMHUag5o5E1Lo+=uw@mail.gmail.com Backpatch-through: 15
2025-11-10Doc: more uppercase keywords in SQLsDavid Rowley
Per 49d43faa8. These ones were missed. Reported-by: jian he <jian.universality@gmail.com> Author: Erik Wienhold <ewie@ewie.name> Discussion: https://postgr.es/m/CACJufxG5UaQtoYFQKdMCYjpz_5Kggvdgm1gVEW4sNEa_W__FKA@mail.gmail.com
2025-11-08doc: consistently use "structname" and "structfield" markupBruce Momjian
Previously "literal" and "classname" were used, inconsistently, for SQL table and column names. Reported-by: Peter Smith Author: Peter Smith Discussion: https://postgr.es/m/CAHut+Pvtf24r+bdPgBind84dBLPvgNL7aB+=HxAUupdPuo2gRg@mail.gmail.com Backpatch-through: master
2025-11-07docs: fix text by adding/removing parenthesesBruce Momjian
Reported-by: Daisuke Higuchi Author: Daisuke Higuchi, Erik Wienhold Reviewed-by: Erik Wienhold Discussion: https://postgr.es/m/CAEVT6c9FRQcFCzQ8AO=QoeQNA-w6RhTkfOUHzY6N2xD5YnBxhg@mail.gmail.com Backpatch-through: master
2025-11-07doc: Fix incorrect wording for --file in pg_dumpDaniel Gustafsson
The documentation stated that the directory specified by --file must not exist, but pg_dump does allow for empty directories to be specified and used. Author: Daniel Gustafsson <daniel@yesql.se> Reviewed-by: Bruce Momjian <bruce@momjian.us> Discussion: https://postgr.es/m/534AA60D-CF6B-432F-9882-E9737B33D1B7@gmail.com
2025-11-07pgbench: Add --continue-on-error option.Fujii Masao
This commit adds the --continue-on-error option, allowing pgbench clients to continue running even when SQL statements fail for reasons other than serialization or deadlock errors. Without this option (by default), the clients aborts in such cases, which was the only available behavior previously. This option is useful for benchmarks using custom scripts that may raise errors, such as unique constraint violations, where users want pgbench to complete the run despite individual statement failures. Author: Rintaro Ikeda <ikedarintarof@oss.nttdata.com> Co-authored-by: Yugo Nagata <nagata@sraoss.co.jp> Co-authored-by: Fujii Masao <masao.fujii@gmail.com> Reviewed-by: Stepan Neretin <slpmcf@gmail.com> Reviewed-by: Matthias van de Meent <boekewurm+postgres@gmail.com> Reviewed-by: Dilip Kumar <dilipbalaut@gmail.com> Reviewed-by: Srinath Reddy Sadipiralla <srinath2133@gmail.com> Reviewed-by: Hayato Kuroda <kuroda.hayato@fujitsu.com> Reviewed-by: Anthonin Bonnefoy <anthonin.bonnefoy@datadoghq.com> Reviewed-by: Chao Li <lic@highgo.com> Discussion: https://postgr.es/m/44334231a4d214fac382a69cceb7d9fc@oss.nttdata.com
2025-11-07Add seq_sync_error_count to subscription statistics.Amit Kapila
This commit adds a new column, seq_sync_error_count, to the pg_stat_subscription_stats view. This counter tracks the number of errors encountered by the sequence synchronization worker during operation. Since a single worker handles the synchronization of all sequences, this value may reflect errors from multiple sequences. This addition improves observability of sequence synchronization behavior and helps monitor potential issues during replication. Author: Vignesh C <vignesh21@gmail.com> Reviewed-by: shveta malik <shveta.malik@gmail.com> Reviewed-by: Peter Smith <smithpb2250@gmail.com> Reviewed-by: Amit Kapila <amit.kapila16@gmail.com> Discussion: https://postgr.es/m/CAA4eK1LC+KJiAkSrpE_NwvNdidw9F2os7GERUeSxSKv71gXysQ@mail.gmail.com
2025-11-07doc: Fix descriptions of some PGC_POSTMASTER parameters.Fujii Masao
The following parameters can only be set at server start because their context is PGC_POSTMASTER, but this information was missing or incorrectly documented. This commit adds or corrects that information for the following parameters: * debug_io_direct * dynamic_shared_memory_type * event_source * huge_pages * io_max_combine_limit * max_notify_queue_pages * shared_memory_type * track_commit_timestamp * wal_decode_buffer_size Backpatched to all supported branches. Author: Karina Litskevich <litskevichkarina@gmail.com> Reviewed-by: Chao Li <lic@highgo.com> Reviewed-by: Fujii Masao <masao.fujii@gmail.com> Discussion: https://postgr.es/m/CAHGQGwGfPzcin-_6XwPgVbWTOUFVZgHF5g9ROrwLUdCTfjy=0A@mail.gmail.com Backpatch-through: 13
2025-11-07doc: Clarify units for io_combine_limit and io_max_combine_limit.Fujii Masao
If these parameters are set without units, the values are interpreted as blocks. This detail was previously missing from the documentation, so this commit adds it. Backpatch to v17 where io_combine_limit was added. Author: Karina Litskevich <litskevichkarina@gmail.com> Reviewed-by: Chao Li <lic@highgo.com> Reviewed-by: Xuneng Zhou <xunengzhou@gmail.com> Reviewed-by: Fujii Masao <masao.fujii@gmail.com> Discussion: https://postgr.es/m/CACiT8iZCDkz1bNYQNQyvGhXWJExSnJULRTYT894u4-Ti7Yh6jw@mail.gmail.com Backpatch-through: 17
2025-11-06Doc: use uppercase keywords in SQLsDavid Rowley
Use uppercase SQL keywords consistently throughout the documentation to ease reading. Also add whitespace in a couple of places where it improves readability. Author: Erik Wienhold <ewie@ewie.name> Reviewed-by: David Rowley <dgrowleyml@gmail.com> Discussion: https://postgr.es/m/82eb512b-8ed2-46be-b311-54ffd26978c4%40ewie.name
2025-11-05doc: Add section for temporal tablesPeter Eisentraut
This section introduces temporal tables, with a focus on Application Time (which we support) and only a brief mention of System Time (which we don't). It covers temporal primary keys, unique constraints, and temporal foreign keys. We will document temporal update/delete and periods as we add those features. This commit also adds glossary entries for temporal table, application time, and system time. Author: Paul A. Jungwirth <pj@illuminatedcomputing.com> Discussion: https://www.postgresql.org/message-id/flat/ec498c3d-5f2b-48ec-b989-5561c8aa2024@illuminatedcomputing.com
2025-11-05Implement WAIT FOR commandAlexander Korotkov
WAIT FOR is to be used on standby and specifies waiting for the specific WAL location to be replayed. This option is useful when the user makes some data changes on primary and needs a guarantee to see these changes are on standby. WAIT FOR needs to wait without any snapshot held. Otherwise, the snapshot could prevent the replay of WAL records, implying a kind of self-deadlock. This is why separate utility command seems appears to be the most robust way to implement this functionality. It's not possible to implement this as a function. Previous experience shows that stored procedures also have limitation in this aspect. Discussion: https://www.postgresql.org/message-id/flat/CAPpHfdsjtZLVzxjGT8rJHCYbM0D5dwkO+BBjcirozJ6nYbOW8Q@mail.gmail.com Discussion: https://www.postgresql.org/message-id/flat/CABPTF7UNft368x-RgOXkfj475OwEbp%2BVVO-wEXz7StgjD_%3D6sw%40mail.gmail.com Author: Kartyshov Ivan <i.kartyshov@postgrespro.ru> Author: Alexander Korotkov <aekorotkov@gmail.com> Author: Xuneng Zhou <xunengzhou@gmail.com> Reviewed-by: Michael Paquier <michael@paquier.xyz> Reviewed-by: Peter Eisentraut <peter.eisentraut@enterprisedb.com> Reviewed-by: Dilip Kumar <dilipbalaut@gmail.com> Reviewed-by: Amit Kapila <amit.kapila16@gmail.com> Reviewed-by: Alexander Lakhin <exclusion@gmail.com> Reviewed-by: Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com> Reviewed-by: Euler Taveira <euler@eulerto.com> Reviewed-by: Heikki Linnakangas <hlinnaka@iki.fi> Reviewed-by: Kyotaro Horiguchi <horikyota.ntt@gmail.com> Reviewed-by: jian he <jian.universality@gmail.com> Reviewed-by: Álvaro Herrera <alvherre@kurilemu.de> Reviewed-by: Xuneng Zhou <xunengzhou@gmail.com>
2025-11-05Drop unnamed portal immediately after execution to completionMichael Paquier
Previously, unnamed portals were kept until the next Bind message or the end of the transaction. This could cause temporary files to persist longer than expected and make logging not reflect the actual SQL responsible for the temporary file. This patch changes exec_execute_message() to drop unnamed portals immediately after execution to completion at the end of an Execute message, making their removal more aggressive. This forces temporary file cleanups to happen at the same time as the completion of the portal execution, with statement logging correctly reflecting to which statements these temporary files were attached to (see the diffs in the TAP test updated by this commit for an idea). The documentation is updated to describe the lifetime of unnamed portals, and test cases are updated to verify temporary file removal and proper statement logging after unnamed portal execution. This changes how unnamed portals are handled in the protocol, hence no backpatch is done. Author: Frédéric Yhuel <frederic.yhuel@dalibo.com> Co-Authored-by: Sami Imseih <samimseih@gmail.com> Co-Authored-by: Mircea Cadariu <cadariu.mircea@gmail.com> Discussion: https://postgr.es/m/CAA5RZ0tTrTUoEr3kDXCuKsvqYGq8OOHiBwoD-dyJocq95uEOTQ%40mail.gmail.com
2025-11-04Allow "SET list_guc TO NULL" to specify setting the GUC to empty.Tom Lane
We have never had a SET syntax that allows setting a GUC_LIST_INPUT parameter to be an empty list. A locution such as SET search_path = ''; doesn't mean that; it means setting the GUC to contain a single item that is an empty string. (For search_path the net effect is much the same, because search_path ignores invalid schema names and '' must be invalid.) This is confusing, not least because configuration-file entries and the set_config() function can easily produce empty-list values. We considered making the empty-string syntax do this, but that would foreclose ever allowing empty-string items to be valid in list GUCs. While there isn't any obvious use-case for that today, it feels like the kind of restriction that might hurt someday. Instead, let's accept the forbidden-up-to-now value NULL and treat that as meaning an empty list. (An objection to this could be "what if we someday want to allow NULL as a GUC value?". That seems unlikely though, and even if we did allow it for scalar GUCs, we could continue to treat it as meaning an empty list for list GUCs.) Author: Tom Lane <tgl@sss.pgh.pa.us> Reviewed-by: Andrei Klychkov <andrew.a.klychkov@gmail.com> Reviewed-by: Jim Jones <jim.jones@uni-muenster.de> Discussion: https://postgr.es/m/CA+mfrmwsBmYsJayWjc8bJmicxc3phZcHHY=yW5aYe=P-1d_4bg@mail.gmail.com
2025-11-03Doc: cover index CONCURRENTLY causing errors in INSERT ... ON CONFLICT.Noah Misch
Author: Mikhail Nikalayeu <mihailnikalayeu@gmail.com> Reviewed-by: Noah Misch <noah@leadboat.com> Discussion: https://postgr.es/m/CANtu0ojXmqjmEzp-=aJSxjsdE76iAsRgHBoK0QtYHimb_mEfsg@mail.gmail.com Backpatch-through: 13
2025-11-03Add \pset options for boolean value displayÁlvaro Herrera
New \pset variables display_true and display_false allow the user to change how true and false values are displayed. Author: David G. Johnston <David.G.Johnston@gmail.com> Reviewed-by: Álvaro Herrera <alvherre@kurilemu.de> Discussion: https://postgr.es/m/CAKFQuwYts3vnfQ5AoKhEaKMTNMfJ443MW2kFswKwzn7fiofkrw@mail.gmail.com Discussion: https://postgr.es/m/56308F56.8060908@joh.to
2025-10-31Mark function arguments of type "Datum *" as "const Datum *" where possiblePeter Eisentraut
Several functions in the codebase accept "Datum *" parameters but do not modify the pointed-to data. These have been updated to take "const Datum *" instead, improving type safety and making the interfaces clearer about their intent. This change helps the compiler catch accidental modifications and better documents immutability of arguments. Most of "Datum *" parameters have a pairing "bool *isnull" parameter, they are constified as well. No functional behavior is changed by this patch. Author: Chao Li <lic@highgo.com> Discussion: https://www.postgresql.org/message-id/flat/CAEoWx2msfT0knvzUa72ZBwu9LR_RLY4on85w2a9YpE-o2By5HQ@mail.gmail.com
2025-10-30doc: rewrite random_page_cost descriptionBruce Momjian
This removes some of the specifics of how the default was set, and adds a mention of latency as a reason the value is lower than the storage hardware might suggest. It still mentions caching. Discussion: https://postgr.es/m/CAKAnmmK_nSPYr53LobUwQD59a-8U9GEC3XGJ43oaTYJq5nAOkw@mail.gmail.com Backpatch-through: 13
2025-10-30docs: Link to the correct protocol version inspection functionPeter Eisentraut
The docs for max_protocol_version suggested PQprotocolVersion() instead of PQfullProtocolVersion() to find out the exact protocol version. Since PQprotocolVersion() only returns the major protocol version, that is bad advice. Author: Jelte Fennema-Nio <postgres@jeltef.nl> Reviewed-by: Shinya Kato <shinya11.kato@gmail.com> Discussion: https://www.postgresql.org/message-id/flat/CAGECzQSKFxQsYAgr11PhdOr-RtPZEdAXZnHx6U3avLuk3xQaTQ%40mail.gmail.com
2025-10-30Expose wal_fpi_bytes in EXPLAIN (WAL)Michael Paquier
The new wal_fpi_bytes counter calculates the total amount of full page images inserted in WAL records, in bytes. This commit exposes this information in EXPLAIN (ANALYZE, WAL) alongside the existing counters, for both the text and JSON/YAML outputs, building upon f9a09aa29520. Author: Shinya Kato <shinya11.kato@gmail.com> Reviewed-by: Michael Paquier <michael@paquier.xyz> Discusssion: https://postgr.es/m/CAOzEurQtZEAfg6P0kU3Wa-f9BWQOi0RzJEMPN56wNTOmJLmfaQ@mail.gmail.com
2025-10-28Add psql PROMPT variable for search_path.Nathan Bossart
The new %S substitution shows the current value of search_path. Note that this only works when connected to Postgres v18 or newer, since search_path was first marked as GUC_REPORT in commit 28a1121fd9. On older versions that don't report search_path, %S is replaced with a question mark. Suggested-by: Lauri Siltanen <lauri.siltanen@gmail.com> Author: Florents Tselai <florents.tselai@gmail.com> Reviewed-by: Jelte Fennema-Nio <postgres@jeltef.nl> Reviewed-by: Jim Jones <jim.jones@uni-muenster.de> Reviewed-by: Chao Li <li.evan.chao@gmail.com> Discussion: https://postgr.es/m/CANsM767JhTKCRagTaq5Lz52fVwLPVkhSpyD1C%2BOrridGv0SO0A%40mail.gmail.com
2025-10-28Add wal_fpi_bytes to pg_stat_wal and pg_stat_get_backend_wal()Michael Paquier
This new counter, called "wal_fpi_bytes", tracks the total amount in bytes of full page images (FPIs) generated in WAL. This data becomes available globally via pg_stat_wal, and for backend statistics via pg_stat_get_backend_wal(). Previously, this information could only be retrieved with pg_waldump or pg_walinspect, which may not be available depending on the environment, and are expensive to execute. It offers hints about how much FPIs impact the WAL generated, which could be a large percentage for some workloads, as well as the effects of wal_compression or page holes. Bump catalog version. Bump PGSTAT_FILE_FORMAT_ID, due to the addition of wal_fpi_bytes in PgStat_WalCounters. Author: Shinya Kato <shinya11.kato@gmail.com> Reviewed-by: Michael Paquier <michael@paquier.xyz> Discussion: https://postgr.es/m/CAOzEurQtZEAfg6P0kU3Wa-f9BWQOi0RzJEMPN56wNTOmJLmfaQ@mail.gmail.com
2025-10-25pg_rewind: Skip copy of WAL segments generated before point of divergenceMichael Paquier
This commit makes the way WAL segments are handled from the source to the target server slightly smarter: the copy of the WAL segments is now skipped if these have been created before the point where source and target have diverged (the WAL segment where the point of divergence exists is still copied), because we know that such segments exist on both the target and source. Note that the on-disk size of the WAL segments on the source and target need to match. Hence, only the segments generated after the point of divergence are now copied. A segment existing on the source but not the target is copied. Previously, all the WAL segments were just copied in full. This change can make the rewind operation cheaper in some configurations, especially for setups where some WAL retention causes many segments to remain on the source server even after the promotion of a standby used as source to rewind a previous primary. A TAP test is added to track these new behaviors. The file map printed with --debug now includes all the information related to WAL segments, to be able to track if these are copied or skipped, and the test relies on the debug output generated. Author: John Hsu <johnhyvr@gmail.com> Author: Justin Kwan <justinpkwan@outlook.com> Reviewed-by: Robert Haas <robertmhaas@gmail.com> Reviewed-by: Alexander Korotkov <aekorotkov@gmail.com> Reviewed-by: Japin Li <japinli@hotmail.com> Reviewed-by: Michael Paquier <michael@paquier.xyz> Reviewed-by: Srinath Reddy Sadipiralla <srinath2133@gmail.com> Discussion: https://postgr.es/m/181b4c6fa9c.b8b725681941212.7547232617810891479@viggy28.dev
2025-10-23doc: Remove mention of Git protocol supportDaniel Gustafsson
The project Git server hasn't supported cloning with the Git protocol in a very long time, but the documentation never got the memo. Remove the mention of using the Git protocol, and while there wrap a mention of Git in <productname> tags. Backpatch down to all supported versions. Author: Daniel Gustafsson <daniel@yesql.se> Reported-by: Gurjeet Singh <gurjeet@singh.im> Reviewed-by: Nathan Bossart <nathandbossart@gmail.com> Reviewed-by: Jacob Champion <jacob.champion@enterprisedb.com> Reviewed-by: Gurjeet Singh <gurjeet@singh.im> Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://postgr.es/m/CABwTF4WMiMb-KT2NRcib5W0C8TQF6URMb+HK9a_=rnZnY8Q42w@mail.gmail.com Backpatch-through: 13
2025-10-23Introduce "REFRESH SEQUENCES" for subscriptions.Amit Kapila
This patch adds support for a new SQL command: ALTER SUBSCRIPTION ... REFRESH SEQUENCES This command updates the sequence entries present in the pg_subscription_rel catalog table with the INIT state to trigger resynchronization. In addition to the new command, the following subscription commands have been enhanced to automatically refresh sequence mappings: ALTER SUBSCRIPTION ... REFRESH PUBLICATION ALTER SUBSCRIPTION ... ADD PUBLICATION ALTER SUBSCRIPTION ... DROP PUBLICATION ALTER SUBSCRIPTION ... SET PUBLICATION These commands will perform the following actions: Add newly published sequences that are not yet part of the subscription. Remove sequences that are no longer included in the publication. This ensures that sequence replication remains aligned with the current state of the publication on the publisher side. Note that the actual synchronization of sequence data/values will be handled in a subsequent patch that introduces a dedicated sequence sync worker. Author: Vignesh C <vignesh21@gmail.com> Reviewed-by: Amit Kapila <amit.kapila16@gmail.com> Reviewed-by: shveta malik <shveta.malik@gmail.com> Reviewed-by: Masahiko Sawada <sawada.mshk@gmail.com> Reviewed-by: Hayato Kuroda <kuroda.hayato@fujitsu.com> Reviewed-by: Dilip Kumar <dilipbalaut@gmail.com> Reviewed-by: Peter Smith <smithpb2250@gmail.com> Reviewed-by: Nisha Moond <nisha.moond412@gmail.com> Reviewed-by: Shlok Kyal <shlok.kyal.oss@gmail.com> Reviewed-by: Chao Li <li.evan.chao@gmail.com> Reviewed-by: Hou Zhijie <houzj.fnst@fujitsu.com> Discussion: https://postgr.es/m/CAA4eK1LC+KJiAkSrpE_NwvNdidw9F2os7GERUeSxSKv71gXysQ@mail.gmail.com
2025-10-22Add error_on_null(), checking if the input is the null valueMichael Paquier
This polymorphic function produces an error if the input value is detected as being the null value; otherwise it returns the input value unchanged. This function can for example become handy in SQL function bodies, to enforce that exactly one row was returned. Author: Joel Jacobson <joel@compiler.org> Reviewed-by: Vik Fearing <vik@postgresfriends.org> Reviewed-by: Michael Paquier <michael@paquier.xyz> Discussion: https://postgr.es/m/ece8c6d1-2ab1-45d5-ba12-8dec96fc8886@app.fastmail.com Discussion: https://postgr.es/m/de94808d-ed58-4536-9e28-e79b09a534c7@app.fastmail.com
2025-10-20Support COPY TO for partitioned tables.Masahiko Sawada
Previously, COPY TO command didn't support directly specifying partitioned tables so users had to use COPY (SELECT ...) TO variant. This commit adds direct COPY TO support for partitioned tables, improving both usability and performance. Performance tests show it's faster than the COPY (SELECT ...) TO variant as it avoids the overheads of query processing and sending results to the COPY TO command. When used with partitioned tables, COPY TO copies the same rows as SELECT * FROM table. Row-level security policies of the partitioned table are applied in the same way as when executing COPY TO on a plain table. Author: jian he <jian.universality@gmail.com> Reviewed-by: vignesh C <vignesh21@gmail.com> Reviewed-by: David Rowley <dgrowleyml@gmail.com> Reviewed-by: Melih Mutlu <m.melihmutlu@gmail.com> Reviewed-by: Kirill Reshke <reshkekirill@gmail.com> Reviewed-by: Atsushi Torikoshi <torikoshia@oss.nttdata.com> Reviewed-by: Álvaro Herrera <alvherre@kurilemu.de> Reviewed-by: Masahiko Sawada <sawada.mshk@gmail.com> Reviewed-by: Chao Li <li.evan.chao@gmail.com> Discussion: https://postgr.es/m/CACJufxEZt%2BG19Ors3bQUq-42-61__C%3Dy5k2wk%3DsHEFRusu7%3DiQ%40mail.gmail.com
2025-10-20pg_checksums: Use new routine to retrieve data of PG_VERSIONMichael Paquier
Previously, attempting to use pg_checksums on a cluster with a control file whose version does not match with what thetool is able to support would lead to the following error: pg_checksums: error: pg_control CRC value is incorrect This is confusing, because it would look like the control file is corrupted. However, the contents of the control file are correct, pg_checksums not being able to understand how the past control file is shaped. This commit adds a check based on PG_VERSION, using the facility added by cd0be131ba6f, using the same error message as some of the other frontend tools. A note is added in the documentation about the major version requirement. Author: Michael Banck <mbanck@gmx.net> Discussion: https://postgr.es/m/68f1ff21.170a0220.2c9b5f.4df5@mx.google.com
2025-10-17doc: Clarify when backend_xmin in pg_stat_replication can be NULL.Fujii Masao
Improve the documentation of pg_stat_replication to explain when the backend_xmin column becomes NULL. This happens when a replication slot is used (the xmin is then shown in pg_replication_slots) or when hot_standby_feedback is disabled. Author: Renzo Dani <arons7@gmail.com> Reviewed-by: Fujii Masao <masao.fujii@gmail.com> Discussion: https://postgr.es/m/CA+XOKQAMXzskpdUmj2sg03_5fmiXc2Gs0r3TX1_rmcFcqh+=xQ@mail.gmail.com
2025-10-15Add log_autoanalyze_min_durationPeter Eisentraut
The log output functionality of log_autovacuum_min_duration applies to both VACUUM and ANALYZE, so it is not possible to separate the VACUUM and ANALYZE log output thresholds. Logs are likely to be output only for VACUUM and not for ANALYZE. Therefore, we decided to separate the threshold for log output of VACUUM by autovacuum (log_autovacuum_min_duration) and the threshold for log output of ANALYZE by autovacuum (log_autoanalyze_min_duration). Author: Shinya Kato <shinya11.kato@gmail.com> Reviewed-by: Kasahara Tatsuhito <kasaharatt@oss.nttdata.com> Discussion: https://www.postgresql.org/message-id/flat/CAOzEurQtfV4MxJiWT-XDnimEeZAY+rgzVSLe8YsyEKhZcajzSA@mail.gmail.com