pgsql: Remove unused typedefs

2024-05-16 Thread Peter Eisentraut
Remove unused typedefs

There were a few typedefs that were never used to define a variable or
field.  This had the effect that the buildfarm's typedefs.list would
not include them, and so they would need to be re-added manually to
keep the overall pgindent result perfectly clean.

We can easily get rid of these typedefs to avoid the issue.  In a few
cases, we just let the enum or struct stand on its own without a
typedef around it.  In one case, an enum was abused to define flag
bits; that's better done with macro definitions.

This fixes all the remaining issues with missing entries in the
buildfarm's typedefs.list.

Reviewed-by: Tom Lane 
Discussion: 
https://www.postgresql.org/message-id/1919000.1715815...@sss.pgh.pa.us

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/be5942aee7a012ce7f30bc7a6617903127f29e89

Modified Files
--
src/backend/commands/async.c  |  6 +++---
src/backend/utils/resowner/resowner.c |  6 +++---
src/include/access/xlog.h |  4 ++--
src/include/storage/bufmgr.h  | 12 
src/tools/pgindent/typedefs.list  |  4 
5 files changed, 12 insertions(+), 20 deletions(-)



pgsql: Remove enum WaitEventExtension

2024-05-16 Thread Michael Paquier
Remove enum WaitEventExtension

This enum was used to determine the first ID to use when assigning a
custom wait event for extensions, which is always 1.  It was kept so
as it would be possible to add new in-core wait events in the category
"Extension".  There is no such thing currently, so let's remove this
enum until a case justifying it pops up.  This makes the code simpler
and easier to understand.

This has as effect to switch back autoprewarm.c to use PG_WAIT_EXTENSION
rather than WAIT_EVENT_EXTENSION, on par with v16 and older stable
branches.

Thinko in c9af05465307.

Reported-by: Peter Eisentraut
Discussion: 
https://postgr.es/m/195c6c45-abce-4331-be6a-e87724e1d...@eisentraut.org

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/110eb4aefbad683c8f512ee8a7168d1718353baa

Modified Files
--
contrib/pg_prewarm/autoprewarm.c| 4 ++--
src/backend/utils/activity/wait_event.c | 7 +++
src/include/utils/wait_event.h  | 6 --
src/tools/pgindent/typedefs.list| 1 -
4 files changed, 5 insertions(+), 13 deletions(-)



pgsql: Fix documentation about DROP DATABASE FORCE process termination

2024-05-16 Thread Noah Misch
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 3a9b18b3095366cd0c4305441d426d04572d88c1 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.nmi...@google.com

Branch
--
REL_15_STABLE

Details
---
https://git.postgresql.org/pg/commitdiff/484b9587370ecb0325bfc30ca435697f9f52acc6

Modified Files
--
doc/src/sgml/ref/drop_database.sgml | 12 +++-
src/backend/storage/ipc/procarray.c | 25 ++---
2 files changed, 21 insertions(+), 16 deletions(-)



pgsql: Fix documentation about DROP DATABASE FORCE process termination

2024-05-16 Thread Noah Misch
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 3a9b18b3095366cd0c4305441d426d04572d88c1 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.nmi...@google.com

Branch
--
REL_14_STABLE

Details
---
https://git.postgresql.org/pg/commitdiff/01e98e0cdd36167f01b6d618486897eea1cfd09d

Modified Files
--
doc/src/sgml/ref/drop_database.sgml | 12 +++-
src/backend/storage/ipc/procarray.c | 25 ++---
2 files changed, 21 insertions(+), 16 deletions(-)



pgsql: Fix documentation about DROP DATABASE FORCE process termination

2024-05-16 Thread Noah Misch
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 3a9b18b3095366cd0c4305441d426d04572d88c1 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.nmi...@google.com

Branch
--
REL_13_STABLE

Details
---
https://git.postgresql.org/pg/commitdiff/9489f3c6e8cdee1c193c511b523ef9c20deed208

Modified Files
--
doc/src/sgml/ref/drop_database.sgml | 12 +++-
src/backend/storage/ipc/procarray.c | 25 ++---
2 files changed, 21 insertions(+), 16 deletions(-)



pgsql: Fix documentation about DROP DATABASE FORCE process termination

2024-05-16 Thread Noah Misch
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 3a9b18b3095366cd0c4305441d426d04572d88c1 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.nmi...@google.com

Branch
--
REL_16_STABLE

Details
---
https://git.postgresql.org/pg/commitdiff/382284519e141d41f7dc021d6a5fccd5888af8a1

Modified Files
--
doc/src/sgml/ref/drop_database.sgml | 12 +++-
src/backend/storage/ipc/procarray.c | 25 ++---
2 files changed, 21 insertions(+), 16 deletions(-)



pgsql: Fix documentation about DROP DATABASE FORCE process termination

2024-05-16 Thread Noah Misch
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 3a9b18b3095366cd0c4305441d426d04572d88c1 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.nmi...@google.com

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/372700cf3067254317e7e8060662f8fac11500d5

Modified Files
--
doc/src/sgml/ref/drop_database.sgml | 12 +++-
src/backend/storage/ipc/procarray.c | 25 ++---
2 files changed, 21 insertions(+), 16 deletions(-)



pgsql: BitmapHeapScan: Remove incorrect assert and reset field

2024-05-16 Thread Melanie Plageman
BitmapHeapScan: Remove incorrect assert and reset field

04e72ed617be pushed the skip fetch optimization (allowing bitmap heap
scans to operate like index-only scans if none of the underlying data is
needed) into heap AM implementations of bitmap table scan callbacks.

04e72ed617be added an assert that all tuples in blocks eligible for the
optimization had been NULL-filled and emitted by the end of the scan.
This assert is incorrect when not all tuples need be scanned to execute
the query; for example: a join in which not all inner tuples need to be
scanned before skipping to the next outer tuple.

Remove the assert and reset the field on which it previously asserted to
avoid incorrectly emitting NULL-filled tuples from a previous scan on
rescan.

Author: Melanie Plageman
Reviewed-by: Tomas Vondra, Michael Paquier, Alvaro Herrera
Reported-by: Melanie Plageman
Reproduced-by: Tomas Vondra, Richard Guo
Discussion: 
https://postgr.es/m/CAMbWs48orzZVXa7-vP9Nt7vQWLTE04Qy4PePaLQYsVNQgo6qRg%40mail.gmail.com

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/a3e6c6f929912f928fa405909d17bcbf0c1b03ee

Modified Files
--
src/backend/access/heap/heapam.c   |  9 ++---
src/test/regress/expected/join.out | 36 
src/test/regress/sql/join.sql  | 24 
3 files changed, 66 insertions(+), 3 deletions(-)



pgsql: Remove option to fall back from direct to postgres SSL negotiati

2024-05-16 Thread Heikki Linnakangas
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

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/fb5718f35ff667104ab0b9dace3a238113666237

Modified Files
--
doc/src/sgml/libpq.sgml|  49 ++--
src/interfaces/libpq/fe-connect.c  | 142 ++--
src/interfaces/libpq/fe-secure-openssl.c   |   2 +-
src/interfaces/libpq/libpq-int.h   |   6 +-
src/interfaces/libpq/t/005_negotiate_encryption.pl | 254 +
5 files changed, 200 insertions(+), 253 deletions(-)



pgsql: Document that increasing max_connections uses more resources.

2024-05-16 Thread Robert Haas
Document that increasing max_connections uses more resources.

Roberto Mello

Discussion: 
http://postgr.es/m/CAKz==bJBCWrvN77fmuZ2XqD3jazWEb=e80aa4yv9c9tq61y...@mail.gmail.com

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/8ba346283335f7ee5bac2e904c2daad49a204c7c

Modified Files
--
doc/src/sgml/config.sgml | 6 ++
1 file changed, 6 insertions(+)



pgsql: Doc: use true|false rather than on|off for "failover" option

2024-05-16 Thread David Rowley
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_4d5c...@mail.gmail.com

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/fa65a022db26bc446fb67ce1d7ac543fa4bb72e4

Modified Files
--
doc/src/sgml/ref/alter_subscription.sgml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)



pgsql: pg_amcheck: Put new options in consistent order in --help and ma

2024-05-16 Thread Peter Eisentraut
pg_amcheck: Put new options in consistent order in --help and man page

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/94af84f00c5fd3ea840759d85a73204d64e28248

Modified Files
--
doc/src/sgml/ref/pg_amcheck.sgml | 22 +++---
src/bin/pg_amcheck/pg_amcheck.c  |  2 +-
2 files changed, 12 insertions(+), 12 deletions(-)



pgsql: Revert temporal primary keys and foreign keys

2024-05-16 Thread Peter Eisentraut
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:

6db4598fcb8 Add stratnum GiST support function
46a0cd4cefb Add temporal PRIMARY KEY and UNIQUE constraints
86232a49a43 Fix comment on gist_stratnum_btree
030e10ff1a3 Rename pg_constraint.conwithoutoverlaps to conperiod
a88c800deb6 Use daterange and YMD in without_overlaps tests instead of 
tsrange.
5577a71fb0c Use half-open interval notation in without_overlaps tests
34768ee3616 Add temporal FOREIGN KEY contraints
482e108cd38 Add test for REPLICA IDENTITY with a temporal key
c3db1f30cba doc:  clarify PERIOD and WITHOUT OVERLAPS in CREATE TABLE
144c2ce0cc7 Fix ON CONFLICT DO NOTHING/UPDATE for temporal indexes

Discussion: 
https://www.postgresql.org/message-id/d0b64a7a-dfe4-4b84-a906-c7dedfa40...@eisentraut.org

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/8aee330af55d8a759b2b73f5a771d9d34a7b887f

Modified Files
--
contrib/btree_gist/Makefile  |6 +-
contrib/btree_gist/btree_gist--1.7--1.8.sql  |   87 --
contrib/btree_gist/btree_gist.c  |   27 -
contrib/btree_gist/btree_gist.control|2 +-
contrib/btree_gist/expected/stratnum.out |   13 -
contrib/btree_gist/expected/without_overlaps.out |   92 --
contrib/btree_gist/meson.build   |3 -
contrib/btree_gist/sql/stratnum.sql  |3 -
contrib/btree_gist/sql/without_overlaps.sql  |   53 -
doc/src/sgml/catalogs.sgml   |   11 -
doc/src/sgml/gist.sgml   |   77 +-
doc/src/sgml/ref/create_table.sgml   |   94 +-
doc/src/sgml/xindex.sgml |8 +-
src/backend/access/gist/gistutil.c   |   43 -
src/backend/access/gist/gistvalidate.c   |8 +-
src/backend/catalog/heap.c   |1 -
src/backend/catalog/index.c  |4 -
src/backend/catalog/pg_constraint.c  |   60 -
src/backend/commands/indexcmds.c |  148 +-
src/backend/commands/tablecmds.c |  226 +--
src/backend/commands/trigger.c   |1 -
src/backend/commands/typecmds.c  |2 -
src/backend/executor/execIndexing.c  |2 +-
src/backend/optimizer/util/plancat.c |9 +-
src/backend/parser/gram.y|   74 +-
src/backend/parser/parse_utilcmd.c   |   28 +-
src/backend/utils/adt/ri_triggers.c  |  168 +--
src/backend/utils/adt/ruleutils.c|   19 +-
src/backend/utils/cache/relcache.c   |   18 +-
src/bin/pg_dump/pg_dump.c|   16 +-
src/bin/pg_dump/pg_dump.h|1 -
src/bin/pg_dump/t/002_pg_dump.pl |   36 -
src/bin/psql/describe.c  |   12 +-
src/include/access/gist.h|6 +-
src/include/catalog/catversion.h |2 +-
src/include/catalog/index.h  |1 -
src/include/catalog/pg_amproc.dat|   18 -
src/include/catalog/pg_constraint.h  |   27 +-
src/include/catalog/pg_proc.dat  |5 -
src/include/commands/defrem.h|6 +-
src/include/nodes/parsenodes.h   |4 -
src/include/parser/kwlist.h  |1 -
src/test/regress/expected/misc_functions.out |   13 -
src/test/regress/expected/without_overlaps.out   | 1722 --
src/test/regress/parallel_schedule   |2 +-
src/test/regress/sql/misc_functions.sql  |4 -
src/test/regress/sql/without_overlaps.sql| 1461 --
47 files changed, 149 insertions(+), 4475 deletions(-)