Commit Graph

17172 Commits

Author SHA1 Message Date
Tatsuo Ishii 92aff003d7 doc: fix typo in create role manual.
There was a small mistake in the create role manual.

Author: Satoru Koizumi
Reviewed-by: David G. Johnston
Discussion: https://postgr.es/m/flat/20240616.112523.1208348667552014162.t-ishii%40sranhm.sra.co.jp
Backpatch-through: 16
2024-06-16 16:21:46 +09:00
Masahiko Sawada f1affb6705 Reintroduce dead tuple counter in pg_stat_progress_vacuum.
Commit 667e65aac3 changed both num_dead_tuples and max_dead_tuples
columns to dead_tuple_bytes and max_dead_tuple_bytes columns,
respectively. But as per discussion, the number of dead tuples
collected still provides meaningful insights for users.

This commit reintroduces the column for the count of dead tuples,
renamed as num_dead_item_ids. It avoids confusion with the number of
dead tuples removed by VACUUM, which includes dead heap-only tuples
but excludes any pre-existing LP_DEAD items left behind by
opportunistic pruning.

Bump catalog version.

Reviewed-by: Peter Geoghegan, Álvaro Herrera, Andrey Borodin
Discussion: https://postgr.es/m/CAD21AoBL5sJE9TRWPyv%2Bw7k5Ee5QAJqDJEDJBUdAaCzGWAdvZw%40mail.gmail.com
2024-06-14 10:08:15 +09:00
Michael Paquier d872e1b473 doc: Fix description WAL summarizer in glossary
The WAL summarizer is an auxiliary process.

Oversight in 7b1dbf0a8d.

Author: Masahiro Ikeda
Discussion: https://postgr.es/m/d3a5a4278fd8d9e7a47c6aa4db9e9a39@oss.nttdata.com
2024-06-14 09:28:11 +09:00
Michael Paquier 3c992361cd doc: Fix description WAL writer in glossary
The WAL writer is an auxiliary process, but its description in the
glossary did not match that.

This is inexact since d3014fff4c.

Author: Masahiro Ikeda
Discussion: https://postgr.es/m/d3a5a4278fd8d9e7a47c6aa4db9e9a39@oss.nttdata.com
Backpatch-through: 15
2024-06-14 09:26:32 +09:00
Tom Lane 105024a472 Improve the granularity of PQsocketPoll's timeout parameter.
Commit f5e4dedfa exposed libpq's internal function PQsocketPoll
without a lot of thought about whether that was an API we really
wanted to chisel in stone.  The main problem with it is the use of
time_t to specify the timeout.  While we do want an absolute time
so that a loop around PQsocketPoll doesn't have problems with
timeout slippage, time_t has only 1-second resolution.  That's
already problematic for libpq's own internal usage --- for example,
pqConnectDBComplete has long had a kluge to treat "connect_timeout=1"
as 2 seconds so that it doesn't accidentally round to nearly zero.
And it's even less likely to be satisfactory for external callers.
Hence, let's change this while we still can.

The best idea seems to be to use an int64 count of microseconds since
the epoch --- basically the same thing as the backend's TimestampTz,
but let's use the standard Unix epoch (1970-01-01) since that's more
likely for clients to be easy to calculate.  Millisecond resolution
would be plenty for foreseeable uses, but maybe the day will come that
we're glad we used microseconds.

Also, since time(2) isn't especially helpful for computing timeouts
defined this way, introduce a new function PQgetCurrentTimeUSec
to get the current time in this form.

Remove the hack in pqConnectDBComplete, so that "connect_timeout=1"
now means what you'd expect.

We can also remove the "#include <time.h>" that f5e4dedfa added to
libpq-fe.h, since there's no longer a need for time_t in that header.
It seems better for v17 not to enlarge libpq-fe.h's include footprint
from what it's historically been, anyway.

I also failed to resist the temptation to do some wordsmithing
on PQsocketPoll's documentation.

Patch by me, per complaint from Dominique Devienne.

Discussion: https://postgr.es/m/913559.1718055575@sss.pgh.pa.us
2024-06-13 15:14:32 -04:00
Peter Eisentraut a41106dab7 Fix documentation of initdb --show option
It wasn't in the documentation at all (even though we document all the
other debugging-like options).  Also, change the --help output to show
that it exits after showing, similar to other options.
2024-06-13 11:52:35 +02:00
Amit Kapila 3470391e16 Doc: Fix ambuiguity in column lists.
The behavior for columns added later to the table for publications with no
specified column lists was not clear.

Reported-by: Koen De Groote
Author: Peter Smith
Reviewed-by: Vignesh C, Laurenz Albe
Backpatch-through: 15
Discussion: https://postgr.es/m/171621878740.686.11325940592820985181@wrigleys.postgresql.org
2024-06-11 09:39:52 +05:30
Dean Rasheed c50d4f4028 doc: Mention all options equivalent to pg_dump --filter patterns.
In the documentation for pg_dump's new --filter option, added by
commit a5cf808be5, each object pattern should match some other
existing pg_dump option, but some had been omitted, so add them.

Noted by Daniel Gustafsson, reviewed by Ayush Vatsa.

Discussion: https://postgr.es/m/CAEZATCWtVUt51B6BjTUQoS4dcNyOBj%2B04ngL7HSH3ehBXTUt%3Dw%40mail.gmail.com
2024-06-10 14:58:21 +01:00
Tom Lane 2dc1deaea0 Fix behavior of stable functions called from a CALL's argument list.
If the CALL is within an atomic context (e.g. there's an outer
transaction block), _SPI_execute_plan should acquire a fresh snapshot
to execute any such functions with.  We failed to do that and instead
passed them the Portal snapshot, which had been acquired at the start
of the current SQL command.  This'd lead to seeing stale values of
rows modified since the start of the command.

This is arguably a bug in 84f5c2908: I failed to see that "are we in
non-atomic mode" needs to be defined the same way as it is further
down in _SPI_execute_plan, i.e. check !_SPI_current->atomic not just
options->allow_nonatomic.  Alternatively the blame could be laid on
plpgsql, which is unconditionally passing allow_nonatomic = true
for CALL/DO even when it knows it's in an atomic context.  However,
fixing it in spi.c seems like a better idea since that will also fix
the problem for any extensions that may have copied plpgsql's coding
pattern.

While here, update an obsolete comment about _SPI_execute_plan's
snapshot management.

Per report from Victor Yegorov.  Back-patch to all supported versions.

Discussion: https://postgr.es/m/CAGnEboiRe+fG2QxuBO2390F7P8e2MQ6UyBjZSL_w1Cej+E4=Vw@mail.gmail.com
2024-06-07 13:27:26 -04:00
Amit Kapila b560a98a17 Doc: Add the new section "Logical Replication Failover".
This aids the users to ensure that the failover marked slots are synced
to the standby and subscribers can continue replication even when the
publisher node goes down.

Author: Hou Zhijie, Shveta Malik, Amit Kapila
Reviewed-by: Peter Smith, Bertrand Drouvot
Discussion: https://postgr.es/m/OS0PR01MB57164D6F53FB4F6AD29AD9C594FB2@OS0PR01MB5716.jpnprd01.prod.outlook.com
2024-06-07 11:59:27 +05:30
Peter Eisentraut 4b8791743e doc: Fix copy-and-paste mistake
The wording from the "columns" view was copied to the "attributes"
view without the required adjustments.
2024-06-07 08:02:15 +02:00
Jeff Davis 8ba34c698d Collation documentation fixes.
Discussion: https://postgr.es/m/9beecdf7-e8c8-4eab-adc7-fa225c2feefd@eisentraut.org
2024-06-06 16:40:03 -07:00
Bruce Momjian f654f000dd doc PG 17 relnotes: adjust integer bin/oct funcs and psql tab
Reported-by: Dean Rasheed

Discussion: https://postgr.es/m/CAEZATCXiNyExAXxKCO1h6oBB2nbfq9PtdA1nQowRsVFW1eD_MQ@mail.gmail.com

Backpatch-through: master
2024-06-05 20:53:15 -04:00
Nathan Bossart 8111e80c5d Fix documentation for POSIX semaphores.
The documentation for POSIX semaphores is missing a reference to
max_wal_senders.  This commit fixes that in the same way that
commit 4ebe51a5fb fixed the same issue in the documentation for
System V semaphores.

Discussion: https://postgr.es/m/20240517164452.GA1914161%40nathanxps13
Backpatch-through: 12
2024-06-05 15:32:47 -05:00
Michael Paquier fbff304c57 doc: Fix example with database regexp in HBA documentation
This HBA entry was using "local" while specifying an address, which was
incorrect.  While in it, this adjusts the format of the entry to be
aligned with the surroundings.

Oversight in 8fea86830e.

Reported-by: Stéphane Schildknecht
Reviewed-by: David G. Johnston
Discussion: https://postgr.es/m/44662001-54c4-4bfd-be93-35e01ca25fa1@gmail.com
Backpatch-through: 16
2024-06-05 19:56:51 +09:00
Nathan Bossart 4ebe51a5fb Fix documentation for System V semaphores.
The formulas for SEMMNI and SEMMNS do not include the archiver
process, which was converted to an auxiliary process in v14, and
the WAL summarizer process, which was introduced in v17.  This
commit corrects these formulas and adds a missing reference to
max_wal_senders nearby.  Since this section of the documentation
tends to be incorrect quite often, we should likely give up on
documenting the exact formulas in favor of something less fragile,
but that is left as a future exercise.

Reported-by: Sami Imseih
Reviewed-by: Sami Imseih
Discussion: https://postgr.es/m/20240517164452.GA1914161%40nathanxps13
Backpatch-through: 12
2024-06-03 12:10:43 -05:00
Bruce Momjian 8fea1bd541 doc PG 17 relnotes: adjust IN wording
Reported-by: David Rowley

Discussion: https://postgr.es/m/CAApHDvqmW0wQRam4paRbHvLQA+w5CJOCno4BCu=NFRLRhYhtRw@mail.gmail.com

Backpatch-through: master
2024-05-28 00:21:13 -04:00
Bruce Momjian 4cf9aab214 doc PG 17 relnotes: improve btree "set/array" matching item
Reported-by: Peter Geoghegan

Discussion: https://postgr.es/m/CAH2-WznwSs5irUka2deUooSdH7Sts2oPdVv4PCOwhK51fq2ZTg@mail.gmail.com

Backpatch-through: master
2024-05-25 23:56:06 -04:00
Bruce Momjian f3bfa02991 doc PG 17 relnotes: fix "pg_stat_slru_reset" wording
Reported-by: Marcos Pegoraro

Discussion: https://postgr.es/m/CAB-JLwYXrL-8FBfVDX8tevyTJ8y1SMmot5A-5cLqXAAne7W0CQ@mail.gmail.com

Backpatch-through: master
2024-05-25 23:50:20 -04:00
Bruce Momjian 232278ca93 doc PG 17 relnote: adjust "SLRU cache sizes to be configured"
Add Álvaro Herrera as additional item author.

Reported-by: Álvaro Herrera

Discussion: https://postgr.es/m/202405231122.zew2gncy63fo@alvherre.pgsql

Author: Álvaro Herrera

Backpatch-through: master
2024-05-25 23:48:35 -04:00
Bruce Momjian 87331c6823 doc PG 17 relnotes: combine items
Reported-by: Andres Freund

Discussion: https://postgr.es/m/20240524182329.gmzcd3a2zrvyepgy@awork3.anarazel.de

Backpatch-through: master
2024-05-25 23:40:17 -04:00
Peter Eisentraut 6ef762938e doc: Clean up title case use 2024-05-23 08:34:05 +02:00
Michael Paquier dd087e1c13 doc: Fix column_name parameter in ALTER MATERIALIZED VIEW
Parameter column_name must be an existing column because ALTER
MATERIALIZED VIEW cannot add new columns.  The old description was
likely copied from ALTER TABLE.

Author: Erik Wienhold
Discussion: https://postgr.es/m/6880ca53-7961-4eeb-86d5-6bd05fc2027e@ewie.name
Backpatch-through: 12
2024-05-23 13:02:57 +09:00
Alexander Korotkov fbd4321fd5 Don't copy extended statistics during MERGE/SPLIT partition operations
When MERGE/SPLIT created new partitions, it was cloning the extended
statistics of the parent table.

However, extended stats on partitioned tables don't behave like
indexes on partitioned tables (which exist only to create physical
indexes on child tables).  Rather, extended stats on a parent 1) cause
extended stats to be collected and computed across the whole partition
hierarchy, and 2) do not cause extended stats to be computed for the
individual partitions.

"CREATE TABLE ... PARTITION OF" command doesn't copy extended
statistics.  This commit makes createPartitionTable() behave
consistently.

Reported-by: Justin Pryzby
Discussion: https://postgr.es/m/ZiJW1g2nbQs9ekwK%40pryzbyj2023
Author: Alexander Korotkov, Justin Pryzby
2024-05-23 02:22:41 +03:00
Bruce Momjian bac44bc29a doc PG 17 relnotes: fix pg_stat_reset_shared quoting
Reported-by: torikoshia

Discussion: https://postgr.es/m/8ab708436c369d47fcbb23a8ad775ea7@oss.nttdata.com

Backpatch-through: master
2024-05-22 18:50:33 -04:00
Bruce Momjian d0155ba41e doc PG 17 relnotes: fix pg_stat_statements typo
Reported-by: Masahiko Sawada

Discussion: https://postgr.es/m/CAD21AoB_MR=S_Gh=oeJR4ji0GGY+d8747O-5pYcbMbhGOMtAwQ@mail.gmail.com

Author: Masahiko Sawada

Backpatch-through: master
2024-05-22 18:48:16 -04:00
Bruce Momjian 29a9a632c5 doc PG 17 relnotes: adjust SQL/JSON constructor func. authors
Reported-by: Amit Langote

Discussion: https://postgr.es/m/CA+HiwqHA2_2V-UtdEEjX3wMUcO=pAwH2D=9P9cRYGVcNLJkH+w@mail.gmail.com

Author: Amit Langote

Backpatch-through: master
2024-05-22 18:46:26 -04:00
Bruce Momjian 3551da969e doc PG 17 relnotes: adjust builtin collation provider item
Reported-by: Jeff Davis

Discussion: https://postgr.es/m/92e039f6fabc3567169e95e12b39a04c00f8503b.camel@j-davis.com

Backpatch-through: master
2024-05-22 18:39:43 -04:00
Bruce Momjian d2a338e060 doc PG 17 relnotes: add Heikki Linnakangas to vacuum item
Reported-by: Melanie Plageman

Discussion: https://postgr.es/m/CAAKRu_YYR5MXY-xuCpr7DKKugCExTSjRy9Ax8c-z7LKa8dDfwg@mail.gmail.com

Author: Melanie Plageman

Backpatch-through: master
2024-05-22 17:59:22 -04:00
Robert Haas 3bd7b2f465 Doc: return 66c0185a3 to the release notes.
This reverts commit e1e83a7171.

Per further discussion on pgsql-release, we wish to ship beta1 with
that feature, and patch the bug, rather than shipping beta1 with
that feature reverted.
2024-05-21 12:44:21 -04:00
Tom Lane e1e83a7171 Doc: remove 66c0185a3 from release notes.
Discussion: https://postgr.es/m/Zktzf926vslR35Fv@depesz.com
(also some private discussion among pgsql-release)
2024-05-20 15:16:17 -04:00
Bruce Momjian d2a04470aa doc PG 17 relnotes: adjust vacuum items
Reported-by: John Naylor

Discussion: https://postgr.es/m/CANWCAZbPEoFcSjedGsz4AV=_sbwUN4sgjrukVCu-JzrqFC5Hhw@mail.gmail.com

Author: John Naylor

Backpatch-through: master
2024-05-20 09:36:58 -04:00
Bruce Momjian fa25dfcd7e doc PG 17 relnotes: adjust vacuum item to use "or"
Reported-by: David Rowley

Discussion: https://postgr.es/m/CAApHDvrR1ZQ69keUwr5_BGo2iWNqhpZooZSz2g96KnOxO0_GTw@mail.gmail.com

Backpatch-through: master
2024-05-19 20:12:42 -04:00
Bruce Momjian acecd6746c doc PG 17 relnotes: adjust "builtin" collation provider
Reported-by: Daniel Verite

Discussion: https://postgr.es/m/13447ff6-15fd-4137-8339-f4fddda7eb11@manitou-mail.org

Backpatch-through: master
2024-05-18 17:52:56 -04:00
Bruce Momjian 15b4d46308 doc PG 17 relnotes: update to current
Reported-by: jian he

Discussion: https://postgr.es/m/CACJufxE7fbWckFeXdW86VTia2BV+LOcfNR-aPf1cP2fjxEB0Aw@mail.gmail.com

Backpatch-through: master
2024-05-18 17:43:37 -04:00
Bruce Momjian 3f49df98d8 doc PG 17 relnotes: add incremental JSON parser item
Reported-by: Andrew Dunstan

Discussion: https://postgr.es/m/e48dbf1e-62c9-4dbb-8b42-bb9ed898a0ab@dunslane.net

Backpatch-through: master
2024-05-18 12:50:22 -04:00
Bruce Momjian 5829444879 doc PG 17 relnotes: improve JSON casting item
Reported-by: jian he

Discussion: https://postgr.es/m/CACJufxE0HY19F8Oo-wb-+i4bKDamiaL_aUV8qB69_8mwoScZow@mail.gmail.com

Backpatch-through: master
2024-05-18 12:13:59 -04:00
Bruce Momjian b67478b99b doc PG 17 relnotes: adjust vacuum memory item
Reported-by: David Rowley

Discussion: https://postgr.es/m/CAApHDvpZnr+wRMX5Wic9Na60fZSbruEffMoECVubBjv483jV2w@mail.gmail.com

Backpatch-through: master
2024-05-18 10:39:47 -04:00
Peter Eisentraut 17974ec259 Revise GUC names quoting in messages again
After further review, we want to move in the direction of always
quoting GUC names in error messages, rather than the previous (PG16)
wildly mixed practice or the intermittent (mid-PG17) idea of doing
this depending on how possibly confusing the GUC name is.

This commit applies appropriate quotes to (almost?) all mentions of
GUC names in error messages.  It partially supersedes a243569bf6 and
8d9978a717, which had moved things a bit in the opposite direction
but which then were abandoned in a partial state.

Author: Peter Smith <smithpb2250@gmail.com>
Discussion: https://www.postgresql.org/message-id/flat/CAHut%2BPv-kSN8SkxSdoHano_wPubqcg5789ejhCDZAcLFceBR-w%40mail.gmail.com
2024-05-17 11:44:26 +02:00
Noah Misch 372700cf30 Fix documentation about DROP DATABASE FORCE process termination rights.
Specifically, it terminates a background worker even if the caller
couldn't terminate the background worker with pg_terminate_backend().
Commit 3a9b18b309 neglected to update
this.  Back-patch to v13, which introduced DROP DATABASE FORCE.

Reviewed by Amit Kapila.  Reported by Kirill Reshke.

Discussion: https://postgr.es/m/20240429212756.60.nmisch@google.com
2024-05-16 14:11:00 -07:00
Heikki Linnakangas fb5718f35f Remove option to fall back from direct to postgres SSL negotiation
There were three problems with the sslnegotiation options:

1. The sslmode=prefer and sslnegotiation=requiredirect combination was
somewhat dangerous, as you might unintentionally fall back to
plaintext authentication when connecting to a pre-v17 server.

2. There was an asymmetry between 'postgres' and 'direct'
options. 'postgres' meant "try only traditional negotiation", while
'direct' meant "try direct first, and fall back to traditional
negotiation if it fails". That was apparent only if you knew that the
'requiredirect' mode also exists.

3. The "require" word in 'requiredirect' suggests that it's somehow
more strict or more secure, similar to sslmode. However, I don't
consider direct SSL connections to be a security feature.

To address these problems:

- Only allow sslnegotiation='direct' if sslmode='require' or
stronger. And for the record, Jacob and Robert felt that we should do
that (or have sslnegotiation='direct' imply sslmode='require') anyway,
regardless of the first issue.

- Remove the 'direct' mode that falls back to traditional negotiation,
and rename what was called 'requiredirect' to 'direct' instead. In
other words, there is no "try both methods" option anymore, 'postgres'
now means the traditional negotiation and 'direct' means a direct SSL
connection.

Reviewed-by: Jelte Fennema-Nio, Robert Haas, Jacob Champion
Discussion: https://www.postgresql.org/message-id/d3b1608a-a1b6-4eda-9ec5-ddb3e4375808%40iki.fi
2024-05-16 17:17:37 +03:00
Robert Haas 8ba3462833 Document that increasing max_connections uses more resources.
Roberto Mello

Discussion: http://postgr.es/m/CAKz==bJBCWrvN77fmuZ2XqD3jazWEb=E80AA4Yv9C9tQ61YDdQ@mail.gmail.com
2024-05-16 08:46:08 -04:00
David Rowley fa65a022db Doc: use true|false rather than on|off for "failover" option
The CREATE SUBSCRIPTION documentation mentions "false" is the default
option, so let's use true|false rather than on|off in the text which
talks about this option in the ALTER SUBSCRIPTION page.

The other boolean options mentioned in create_subscription.sgml use true
and false so it makes sense to be consistent with these.  The "failover"
option is new to v17.

Author: Peter Smith
Discussion: https://postgr.es/m/CAHut+Ps-RqrggaJU5w85BbeQzw9CLmmLgADVJoJ=xx_4D5CWvw@mail.gmail.com
2024-05-17 00:39:15 +12:00
Peter Eisentraut 94af84f00c pg_amcheck: Put new options in consistent order in --help and man page 2024-05-16 11:29:41 +02:00
Peter Eisentraut 8aee330af5 Revert temporal primary keys and foreign keys
This feature set did not handle empty ranges correctly, and it's now
too late for PostgreSQL 17 to fix it.

The following commits are reverted:

    6db4598fcb Add stratnum GiST support function
    46a0cd4cef Add temporal PRIMARY KEY and UNIQUE constraints
    86232a49a4 Fix comment on gist_stratnum_btree
    030e10ff1a Rename pg_constraint.conwithoutoverlaps to conperiod
    a88c800deb Use daterange and YMD in without_overlaps tests instead of tsrange.
    5577a71fb0 Use half-open interval notation in without_overlaps tests
    34768ee361 Add temporal FOREIGN KEY contraints
    482e108cd3 Add test for REPLICA IDENTITY with a temporal key
    c3db1f30cb doc:  clarify PERIOD and WITHOUT OVERLAPS in CREATE TABLE
    144c2ce0cc Fix ON CONFLICT DO NOTHING/UPDATE for temporal indexes

Discussion: https://www.postgresql.org/message-id/d0b64a7a-dfe4-4b84-a906-c7dedfa40a3e@eisentraut.org
2024-05-16 08:17:46 +02:00
Bruce Momjian f6ebb41831 doc PG 17 relnotes: wording adjustments
Reported-by: jian he

Discussion: https://postgr.es/m/CACJufxHTJBqDmBC4iPgte_xd4aMgONRm680Ji5m5gCA8+YEmJg@mail.gmail.com

Co-authored-by: jian he

Backpatch-through: master
2024-05-15 22:54:29 -04:00
Bruce Momjian a8010d03e1 doc PG 17 relnotes: add item about vacuum storage/limits/WAL
Reported-by: Alvaro Herrera

Discussion: https://postgr.es/m/202405150838.sg5ddcexyyf4@alvherre.pgsql

Backpatch-through: master
2024-05-15 22:48:19 -04:00
Michael Paquier f01e3ba56f doc: Mention more variant --name=value of -c name=value for postgres
postgres --name=value and -c name=value are equivalents.  This commit
expands the documentation of libpq's "option" connection parameter and
the server startup sequence for shell interactions to mention both
rather than only -c.

Extracted from a larger patch by the same authors.

Reported-by: Alexey Palazhchenko
Author: David Johnston, Aleksander Alekseev
Reviewed-by: Nathan Bossart, Peter Eisentraut, Álvaro Herrera
Discussion: https://postgr.es/m/CAJ7c6TMkuLiLfrA+EFCPYfhXoMKRxxssB5c86+ibxfaz6+=Sdg@mail.gmail.com
2024-05-16 09:15:01 +09:00
Peter Eisentraut 96bc29edfd doc: Add standard Environment section to pg_upgrade ref page
Reviewed-by: Daniel Gustafsson <daniel@yesql.se>
Discussion: https://www.postgresql.org/message-id/flat/8458c9c5-18f1-46d7-94c4-1c30e4f44908%40eisentraut.org
2024-05-15 13:06:12 +02:00
Peter Eisentraut cff942453f doc: Add standard Environment section to pg_amcheck ref page
Reviewed-by: Daniel Gustafsson <daniel@yesql.se>
Discussion: https://www.postgresql.org/message-id/flat/8458c9c5-18f1-46d7-94c4-1c30e4f44908%40eisentraut.org
2024-05-15 13:06:12 +02:00