Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DO NOT SQUASH MERGE] Community Merge for 4_X #491

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
144 commits
Select commit Hold shift + click to select a range
9dda1ac
Make fallback MD5 implementation thread-safe on big-endian systems
hlinnaka Aug 7, 2024
07653b2
Fix edge case in plpgsql's make_callstmt_target().
tglsfdc Aug 7, 2024
88b00e0
Revert ECPG's use of pnstrdup()
petere Aug 7, 2024
13240f2
Fix pg_rewind debug output to print the source timeline history
hlinnaka Aug 8, 2024
a261bde
Refuse ATTACH of a table referenced by a foreign key
alvherre Aug 8, 2024
08cfdaf
Fix "failed to find plan for subquery/CTE" errors in EXPLAIN.
tglsfdc Aug 9, 2024
f99dfc2
doc: Fix name of CRC algorithm in "Reliability" section.
nathan-bossart Aug 9, 2024
57125b9
Allow adjusting session_authorization and role in parallel workers.
tglsfdc Aug 10, 2024
4cb6e14
Suppress Coverity warnings about Asserts in get_name_for_var_field.
tglsfdc Aug 11, 2024
7d20203
Fix creation of partition descriptor during concurrent detach+drop
alvherre Aug 12, 2024
1b14f50
docs: fix incorrect plpgsql error message
bmomjian Aug 17, 2024
0f3ae22
Fix DROP DATABASE for databases with many ACLs
tvondra Aug 18, 2024
cce4b8f
ci: Upgrade MacPorts version to 2.10.1.
macdice Aug 18, 2024
fa6f43f
Fix harmless LC_COLLATE[_MASK] confusion.
macdice Aug 19, 2024
b499b94
Fix regression in TLS session ticket disabling
danielgustafsson Aug 19, 2024
fa04560
Explain dropdb can't use syscache because of TOAST
tvondra Aug 19, 2024
f2454e9
Avoid failure to open dropped detached partition
alvherre Aug 19, 2024
3ad6ebb
Document limit on the number of out-of-line values per table
j-naylor Aug 20, 2024
5f0d033
Fix a couple of wait event descriptions.
nathan-bossart Aug 20, 2024
324ba10
Minor wording change in table "JSON Creation Functions"
alvherre Aug 20, 2024
1e97a00
Don't advance origin during apply failure.
Aug 21, 2024
efe3d31
Disallow USING clause when altering type of generated column
petere Aug 29, 2024
73fd931
Fix mis-deparsing of ORDER BY lists when there is a name conflict.
tglsfdc Aug 29, 2024
2cb54a2
Avoid inserting PlaceHolderVars in cases where pre-v16 PG did not.
tglsfdc Aug 30, 2024
4184e22
Clarify restrict_nonsystem_relation_kind description.
MasahikoSawada Aug 30, 2024
d9d3f48
Stabilize 039_end_of_wal test.
macdice Aug 31, 2024
2cd540f
Prevent mis-encoding of "trailing junk after numeric literal" errors.
tglsfdc Sep 5, 2024
2f1d3d6
Fix incorrect pg_stat_io output on 32-bit machines.
tglsfdc Sep 6, 2024
9bd6711
Fix waits of REINDEX CONCURRENTLY for indexes with predicates or expr…
michaelpq Sep 9, 2024
9012c9c
Fix some whitespace issues in XMLSERIALIZE(... INDENT).
tglsfdc Sep 10, 2024
56b4c71
Fix unique key checks in JSON object constructors
tvondra Sep 11, 2024
2442340
Remove incorrect Assert.
tglsfdc Sep 11, 2024
fc129fc
Doc: alphabetize aggregate function table
david-rowley Sep 12, 2024
c648dca
Reintroduce support for sequences in pgstattuple and pageinspect.
nathan-bossart Sep 12, 2024
d604326
Fix contrib/pageinspect's test for sequences.
nathan-bossart Sep 13, 2024
18c5c71
Allow _h_indexbuild() to be interrupted.
tglsfdc Sep 13, 2024
011c181
Only define NO_THREAD_SAFE_LOCALE for MSVC plperl when required
adunstan Sep 14, 2024
cf62ee7
Improve meson's detection of perl build flags
adunstan Sep 14, 2024
b8a5a80
Run regression tests with timezone America/Los_Angeles.
tglsfdc Sep 14, 2024
307e077
doc PG relnotes: add attribution for time zone data files items
bmomjian Sep 14, 2024
e21fd10
Replace usages of xmlXPathCompile() with xmlXPathCtxtCompile().
tglsfdc Sep 15, 2024
a997039
scripts: add Perl script to add links to release notes
bmomjian Sep 16, 2024
ea8e266
doc PG relnotes: add links to commits
bmomjian Sep 16, 2024
70e7dd7
doc PG relnotes: fix SGML markup for new commit links
bmomjian Sep 16, 2024
acb66fd
Repair pg_upgrade for identity sequences with non-default persistence.
tglsfdc Sep 17, 2024
5fecbea
Add missing query ID reporting in extended query protocol
michaelpq Sep 18, 2024
436f94c
Don't enter parallel mode when holding interrupts.
nmisch Sep 18, 2024
730ae76
doc PG relnotes: no relnote footnotes for commit links in PDF
bmomjian Sep 18, 2024
ca20381
doc PG relnotes: add paragraph explaining the section symbol
bmomjian Sep 18, 2024
d8eac51
psql: Fix memory leak with repeated calls of \bind
michaelpq Sep 19, 2024
198ad79
Improve Perl script which adds commit links to release notes
bmomjian Sep 19, 2024
a671380
doc PG relnotes: rename commit link paragraph for clarity
bmomjian Sep 19, 2024
893e4ff
doc PG relnotes: document "Unresolved ID reference found" cause
bmomjian Sep 19, 2024
191cb43
doc PG relnotes: remove warning about commit links in PDF build
bmomjian Sep 19, 2024
e14a46c
Doc: explain how to test ADMIN privilege with pg_has_role().
tglsfdc Sep 20, 2024
2a657e7
Drop global objects after completed test
danielgustafsson Apr 3, 2024
e004ed0
Allow meson builds to run test_pg_dump test in installcheck mode.
tglsfdc Apr 29, 2024
f1e2815
Warn if LOCKTAG_TUPLE is held at commit, under debug_assertions.
nmisch Sep 24, 2024
cd5da01
Fix data loss at inplace update after heap_update().
nmisch Sep 24, 2024
3670574
For inplace update durability, make heap_update() callers wait.
nmisch Sep 24, 2024
e52530b
Fix use of uninitialized value in previous commit.
nmisch Sep 25, 2024
c4395a4
vacuumdb: Skip temporary tables in query to build list of relations
michaelpq Sep 25, 2024
9e4ef88
Fix incorrect memory access in VACUUM FULL with invalid toast indexes
michaelpq Sep 27, 2024
0ffdfab
Avoid 037_invalid_database.pl hang under debug_discard_caches.
nmisch Sep 27, 2024
6946208
Remove NULL dereference from RenameRelationInternal().
nmisch Sep 29, 2024
c905021
reindexdb: Skip reindexing temporary tables and indexes.
MasaoFujii Sep 30, 2024
fade5f3
Doc: replace unnecessary non-breaking space with ordinal space.
tatsuo-ishii Oct 1, 2024
ae4bae0
Fix race condition in COMMIT PREPARED causing orphaned 2PC files
michaelpq Oct 1, 2024
f4a5a3b
doc: Clarify name of files generated by pg_waldump --save-fullpage
michaelpq Oct 2, 2024
8613dfa
Parse libpq's "keepalives" option more like other integer options.
tglsfdc Oct 2, 2024
87506b0
Reject non-ASCII locale names.
macdice Oct 5, 2024
c7441f3
Ignore not-yet-defined Portals in pg_cursors view.
tglsfdc Oct 6, 2024
65096a4
Fix fetching default toast value during decoding of in-progress trans…
Oct 7, 2024
2239685
Fix Y2038 issues with MyStartTime.
nathan-bossart Oct 7, 2024
2135faf
vacuumdb: Schema-qualify operator in catalog query's WHERE clause.
nathan-bossart Oct 7, 2024
a7bfa5c
Stabilize the test added by commit 022564f60c.
Oct 8, 2024
a715f57
Remove incorrect function import from pgindent
danielgustafsson Oct 9, 2024
2c9ecf5
Correctly identify which EC members are computable at a plan node.
tglsfdc Oct 12, 2024
d2d4ed2
psql: Fix \watch when using interval values less than 1ms
michaelpq Oct 14, 2024
d0a317a
Fix typo in comment of transformJsonAggConstructor()
amitlan Oct 16, 2024
bfb5ec0
Reduce memory block size for decoded tuple storage to 8kB.
MasahikoSawada Oct 16, 2024
bd673dc
Further refine _SPI_execute_plan's rule for atomic execution.
tglsfdc Oct 16, 2024
33e52b5
Rewrite some regression queries for option checks with COPY
michaelpq Oct 16, 2024
c5b1a4b
Fix extreme skew detection in Parallel Hash Join.
macdice Oct 17, 2024
2f74528
Adjust documentation for configuring Linux huge pages.
nathan-bossart Oct 18, 2024
af265e4
SQL/JSON: Fix some oversights in commit b6e1157e7
amitlan Oct 20, 2024
4a91c27
Note that index_name in ALTER INDEX ATTACH PARTITION can be schema-qu…
alvherre Oct 20, 2024
a86cc9f
Fix race condition in committing a serializable transaction
hlinnaka Oct 21, 2024
82dd7ee
Fix wrong assertion and poor error messages in "COPY (query) TO".
tglsfdc Oct 21, 2024
29fbab8
Restructure foreign key handling code for ATTACH/DETACH
alvherre Oct 22, 2024
90de691
ecpg: Fix out-of-bound read in DecodeDateTime()
michaelpq Oct 22, 2024
dc5cd52
Remove unnecessary word in a comment
amitlan Oct 23, 2024
b56dbae
Stop reading uninitialized memory in heap_inplace_lock().
nmisch Oct 24, 2024
eb91d69
At end of recovery, reset all sinval-managed caches.
nmisch Oct 25, 2024
488201e
For inplace update, send nontransactional invalidations.
nmisch Oct 25, 2024
04aabde
WAL-log inplace update before revealing it to other sessions.
nmisch Oct 25, 2024
272f8eb
Fix overflow in bsearch_arg() with more than INT_MAX elements
hlinnaka Oct 28, 2024
a8c2d4f
Guard against enormously long input in pg_saslprep().
tglsfdc Oct 28, 2024
7a75af4
Doc: clarify enable_indexscan=off also disabled Index Only Scans
david-rowley Oct 29, 2024
3cac81a
doc: Add better description for rewrite functions in event triggers
michaelpq Oct 29, 2024
d20df34
Update time zone data files to tzdata release 2024b.
tglsfdc Oct 29, 2024
73cffea
Unpin buffer before inplace update waits for an XID to end.
nmisch Oct 29, 2024
ae4835a
Fix some more bugs in foreign keys connecting partitioned tables
alvherre Oct 30, 2024
7a73760
doc: remove mention of ActiveState for Perl and Tcl on Windows
bmomjian Nov 1, 2024
c20e5a6
doc: fix ALTER DOMAIN domain_constraint to spell out options
bmomjian Nov 1, 2024
72fe044
Revert "WAL-log inplace update before revealing it to other sessions."
nmisch Nov 2, 2024
7e2628a
Revert "For inplace update, send nontransactional invalidations."
nmisch Nov 2, 2024
43d2c9e
Move I/O before the index_update_stats() buffer lock region.
nmisch Nov 2, 2024
1332bb1
Suppress new "may be used uninitialized" warning.
nmisch Nov 3, 2024
ba03bbe
Use portable diff options in pg_bsd_indent's regression test.
tglsfdc Nov 4, 2024
cb06789
Clear padding of PgStat_HashKey when handling pgstats entries
michaelpq Nov 5, 2024
e15dd77
Monkey-patch LLVM code to fix ARM relocation bug.
macdice Nov 6, 2024
7c9db97
doc: Reword ALTER TABLE ATTACH restriction on NO INHERIT constraints
alvherre Nov 7, 2024
03566ba
Message style improvement
petere Nov 8, 2024
cffff05
Disallow partitionwise grouping when collations don't match
amitlan Nov 8, 2024
e0f708e
Disallow partitionwise join when collations don't match
amitlan Nov 8, 2024
a434fe5
Improve fix for not entering parallel mode when holding interrupts.
tglsfdc Nov 8, 2024
505a3e5
Release notes for 17.1, 16.5, 15.9, 14.14, 13.17, 12.21.
tglsfdc Nov 10, 2024
6df1595
libpq: Bail out during SSL/GSS negotiation errors
michaelpq Nov 11, 2024
3e06181
Translation updates
petere Nov 11, 2024
7a75dd8
Block environment variable mutations from trusted PL/Perl.
nmisch Nov 11, 2024
aef18ea
Ensure cached plans are correctly marked as dependent on role.
nathan-bossart Nov 11, 2024
317b189
Fix improper interactions between session_authorization and role.
tglsfdc Nov 11, 2024
f7572b8
Avoid bizarre meson behavior with backslashes in command arguments.
tglsfdc Nov 11, 2024
cad9008
Avoid bizarre meson behavior with backslashes in command arguments.
tglsfdc Nov 11, 2024
0e8beea
src/tools/msvc: Respect REGRESS_OPTS in plcheck.
nmisch Nov 11, 2024
96d12a4
Fix cross-version upgrade tests.
tglsfdc Nov 11, 2024
c11413b
Parallel workers use AuthenticatedUserId for connection privilege che…
tglsfdc Nov 11, 2024
ed0612d
Last-minute updates for release notes.
tglsfdc Nov 11, 2024
b1e330c
Stamp 16.5.
tglsfdc Nov 11, 2024
c14db1a
Fix arrays comparison in CompareOpclassOptions()
akorotkov Nov 11, 2024
a7ac136
Count contrib/bloom index scans in pgstat view.
petergeoghegan Nov 13, 2024
f1ff927
Fix race conditions with drop of reused pgstats entries
michaelpq Nov 15, 2024
08ed43a
Avoid deleting critical WAL segments during pg_rewind
alvherre Nov 15, 2024
289438b
Avoid assertion due to disconnected NFA sub-graphs in regex parsing.
tglsfdc Nov 15, 2024
c9ebb8d
Fix a possibility of logical replication slot's restart_lsn going bac…
MasahikoSawada Nov 16, 2024
b98df3f
Fix per-session activation of ALTER {ROLE|DATABASE} SET role.
nmisch Nov 16, 2024
517bb4c
Undo unintentional ABI break in struct ResultRelInfo.
tglsfdc Nov 16, 2024
89dd8f4
Release notes for 17.2, 16.6, 15.10, 14.15, 13.18, 12.22.
tglsfdc Nov 16, 2024
2f642cf
Stamp 16.6.
tglsfdc Nov 18, 2024
7850b3d
BABEL: Fixes after community commit 7abe267
Sep 26, 2024
75391f8
BABEL: Fix crash when creating index on Babelfish temp table.
timchang514 Sep 30, 2024
27c8ec6
BABEL: Skip locking the tuple for ENR-related tuple modifications.
Oct 8, 2024
ce3b1b3
BABEL: fix babelfish commit/rollback inside subtransaction post commi…
tanscorpio7 Oct 24, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
18 changes: 9 additions & 9 deletions configure
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for PostgreSQL 16.4.
# Generated by GNU Autoconf 2.69 for PostgreSQL 16.6.
#
# Report bugs to <[email protected]>.
#
Expand Down Expand Up @@ -582,8 +582,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='PostgreSQL'
PACKAGE_TARNAME='postgresql'
PACKAGE_VERSION='16.4'
PACKAGE_STRING='PostgreSQL 16.4'
PACKAGE_VERSION='16.6'
PACKAGE_STRING='PostgreSQL 16.6'
PACKAGE_BUGREPORT='[email protected]'
PACKAGE_URL='https://www.postgresql.org/'

Expand Down Expand Up @@ -1448,7 +1448,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures PostgreSQL 16.4 to adapt to many kinds of systems.
\`configure' configures PostgreSQL 16.6 to adapt to many kinds of systems.

Usage: $0 [OPTION]... [VAR=VALUE]...

Expand Down Expand Up @@ -1513,7 +1513,7 @@ fi

if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of PostgreSQL 16.4:";;
short | recursive ) echo "Configuration of PostgreSQL 16.6:";;
esac
cat <<\_ACEOF

Expand Down Expand Up @@ -1688,7 +1688,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
PostgreSQL configure 16.4
PostgreSQL configure 16.6
generated by GNU Autoconf 2.69

Copyright (C) 2012 Free Software Foundation, Inc.
Expand Down Expand Up @@ -2441,7 +2441,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by PostgreSQL $as_me 16.4, which was
It was created by PostgreSQL $as_me 16.6, which was
generated by GNU Autoconf 2.69. Invocation command line was

$ $0 $@
Expand Down Expand Up @@ -19969,7 +19969,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by PostgreSQL $as_me 16.4, which was
This file was extended by PostgreSQL $as_me 16.6, which was
generated by GNU Autoconf 2.69. Invocation command line was

CONFIG_FILES = $CONFIG_FILES
Expand Down Expand Up @@ -20040,7 +20040,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
PostgreSQL config.status 16.4
PostgreSQL config.status 16.6
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"

Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ dnl Read the Autoconf manual for details.
dnl
m4_pattern_forbid(^PGAC_)dnl to catch undefined macros

AC_INIT([PostgreSQL], [16.4], [[email protected]], [], [https://www.postgresql.org/])
AC_INIT([PostgreSQL], [16.6], [[email protected]], [], [https://www.postgresql.org/])

m4_if(m4_defn([m4_PACKAGE_VERSION]), [2.69], [], [m4_fatal([Autoconf version 2.69 is required.
Untested combinations of 'autoconf' and PostgreSQL versions are not
Expand Down
1 change: 1 addition & 0 deletions contrib/bloom/blscan.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ blgetbitmap(IndexScanDesc scan, TIDBitmap *tbm)
*/
bas = GetAccessStrategy(BAS_BULKREAD);
npages = RelationGetNumberOfBlocks(scan->indexRelation);
pgstat_count_index_scan(scan->indexRelation);

for (blkno = BLOOM_HEAD_BLKNO; blkno < npages; blkno++)
{
Expand Down
10 changes: 10 additions & 0 deletions contrib/pageinspect/expected/page.out
Original file line number Diff line number Diff line change
Expand Up @@ -239,3 +239,13 @@ SELECT page_checksum(decode(repeat('00', :block_size), 'hex'), 1);

(1 row)

-- tests for sequences
create sequence test_sequence start 72057594037927937;
select tuple_data_split('test_sequence'::regclass, t_data, t_infomask, t_infomask2, t_bits)
from heap_page_items(get_raw_page('test_sequence', 0));
tuple_data_split
-------------------------------------------------------
{"\\x0100000000000001","\\x0000000000000000","\\x00"}
(1 row)

drop sequence test_sequence;
6 changes: 5 additions & 1 deletion contrib/pageinspect/heapfuncs.c
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,11 @@ tuple_data_split_internal(Oid relid, char *tupdata,
raw_attrs = initArrayResult(BYTEAOID, CurrentMemoryContext, false);
nattrs = tupdesc->natts;

if (rel->rd_rel->relam != HEAP_TABLE_AM_OID)
/*
* Sequences always use heap AM, but they don't show that in the catalogs.
*/
if (rel->rd_rel->relkind != RELKIND_SEQUENCE &&
rel->rd_rel->relam != HEAP_TABLE_AM_OID)
ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg("only heap AM is supported")));

Expand Down
6 changes: 6 additions & 0 deletions contrib/pageinspect/sql/page.sql
Original file line number Diff line number Diff line change
Expand Up @@ -98,3 +98,9 @@ SHOW block_size \gset
SELECT fsm_page_contents(decode(repeat('00', :block_size), 'hex'));
SELECT page_header(decode(repeat('00', :block_size), 'hex'));
SELECT page_checksum(decode(repeat('00', :block_size), 'hex'), 1);

-- tests for sequences
create sequence test_sequence start 72057594037927937;
select tuple_data_split('test_sequence'::regclass, t_data, t_infomask, t_infomask2, t_bits)
from heap_page_items(get_raw_page('test_sequence', 0));
drop sequence test_sequence;
2 changes: 1 addition & 1 deletion contrib/pg_stat_statements/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ LDFLAGS_SL += $(filter -lm, $(LIBS))

REGRESS_OPTS = --temp-config $(top_srcdir)/contrib/pg_stat_statements/pg_stat_statements.conf
REGRESS = select dml cursors utility level_tracking planning \
user_activity wal cleanup oldextversions
user_activity wal extended cleanup oldextversions
# Disabled because these tests require "shared_preload_libraries=pg_stat_statements",
# which typical installcheck users do not have (e.g. buildfarm clients).
NO_INSTALLCHECK = 1
Expand Down
10 changes: 10 additions & 0 deletions contrib/pg_stat_statements/expected/extended.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
-- Tests with extended query protocol
SET pg_stat_statements.track_utility = FALSE;
-- This test checks that an execute message sets a query ID.
SELECT query_id IS NOT NULL AS query_id_set
FROM pg_stat_activity WHERE pid = pg_backend_pid() \bind \g
query_id_set
--------------
t
(1 row)

1 change: 1 addition & 0 deletions contrib/pg_stat_statements/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ tests += {
'planning',
'user_activity',
'wal',
'extended',
'cleanup',
'oldextversions',
],
Expand Down
7 changes: 7 additions & 0 deletions contrib/pg_stat_statements/sql/extended.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
-- Tests with extended query protocol

SET pg_stat_statements.track_utility = FALSE;

-- This test checks that an execute message sets a query ID.
SELECT query_id IS NOT NULL AS query_id_set
FROM pg_stat_activity WHERE pid = pg_backend_pid() \bind \g
3 changes: 3 additions & 0 deletions contrib/pg_trgm/expected/pg_trgm.out
Original file line number Diff line number Diff line change
Expand Up @@ -2372,6 +2372,9 @@ ERROR: value 2025 out of bounds for option "siglen"
DETAIL: Valid values are between "1" and "2024".
create index trgm_idx on test_trgm using gist (t gist_trgm_ops(siglen=2024));
set enable_seqscan=off;
-- check index compatibility handling when opclass option is specified
alter table test_trgm alter column t type varchar(768);
alter table test_trgm alter column t type text;
select t,similarity(t,'qwertyu0988') as sml from test_trgm where t % 'qwertyu0988' order by sml desc, t;
t | sml
-------------+----------
Expand Down
4 changes: 4 additions & 0 deletions contrib/pg_trgm/sql/pg_trgm.sql
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ create index trgm_idx on test_trgm using gist (t gist_trgm_ops(siglen=2025));
create index trgm_idx on test_trgm using gist (t gist_trgm_ops(siglen=2024));
set enable_seqscan=off;

-- check index compatibility handling when opclass option is specified
alter table test_trgm alter column t type varchar(768);
alter table test_trgm alter column t type text;

select t,similarity(t,'qwertyu0988') as sml from test_trgm where t % 'qwertyu0988' order by sml desc, t;
select t,similarity(t,'gwertyu0988') as sml from test_trgm where t % 'gwertyu0988' order by sml desc, t;
select t,similarity(t,'gwertyu1988') as sml from test_trgm where t % 'gwertyu1988' order by sml desc, t;
Expand Down
25 changes: 25 additions & 0 deletions contrib/pgstattuple/expected/pgstattuple.out
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,31 @@ select pgstathashindex('test_partition_hash_idx');
(4,8,0,1,0,0,0,100)
(1 row)

-- these should work for sequences
create sequence test_sequence;
select count(*) from pgstattuple('test_sequence');
count
-------
1
(1 row)

select pg_relpages('test_sequence');
pg_relpages
-------------
1
(1 row)

-- these should fail for sequences
select pgstatindex('test_sequence');
ERROR: relation "test_sequence" is not a btree index
select pgstatginindex('test_sequence');
ERROR: relation "test_sequence" is not a GIN index
select pgstathashindex('test_sequence');
ERROR: relation "test_sequence" is not a hash index
select pgstattuple_approx('test_sequence');
ERROR: relation "test_sequence" is of wrong relation kind
DETAIL: This operation is not supported for sequences.
drop sequence test_sequence;
drop table test_partitioned;
drop view test_view;
drop foreign table test_foreign_table;
Expand Down
6 changes: 5 additions & 1 deletion contrib/pgstattuple/pgstattuple.c
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,11 @@ pgstat_heap(Relation rel, FunctionCallInfo fcinfo)
pgstattuple_type stat = {0};
SnapshotData SnapshotDirty;

if (rel->rd_rel->relam != HEAP_TABLE_AM_OID)
/*
* Sequences always use heap AM, but they don't show that in the catalogs.
*/
if (rel->rd_rel->relkind != RELKIND_SEQUENCE &&
rel->rd_rel->relam != HEAP_TABLE_AM_OID)
ereport(ERROR,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg("only heap AM is supported")));
Expand Down
12 changes: 12 additions & 0 deletions contrib/pgstattuple/sql/pgstattuple.sql
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,18 @@ create index test_partition_hash_idx on test_partition using hash (a);
select pgstatindex('test_partition_idx');
select pgstathashindex('test_partition_hash_idx');

-- these should work for sequences
create sequence test_sequence;
select count(*) from pgstattuple('test_sequence');
select pg_relpages('test_sequence');

-- these should fail for sequences
select pgstatindex('test_sequence');
select pgstatginindex('test_sequence');
select pgstathashindex('test_sequence');
select pgstattuple_approx('test_sequence');

drop sequence test_sequence;
drop table test_partitioned;
drop view test_view;
drop foreign table test_foreign_table;
Expand Down
2 changes: 1 addition & 1 deletion contrib/postgres_fdw/option.c
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@ process_pgfdw_appname(const char *appname)
appendStringInfoString(&buf, application_name);
break;
case 'c':
appendStringInfo(&buf, "%lx.%x", (long) (MyStartTime), MyProcPid);
appendStringInfo(&buf, "%" INT64_MODIFIER "x.%x", MyStartTime, MyProcPid);
break;
case 'C':
appendStringInfoString(&buf, cluster_name);
Expand Down
23 changes: 23 additions & 0 deletions contrib/test_decoding/expected/twophase.out
Original file line number Diff line number Diff line change
Expand Up @@ -205,10 +205,33 @@ SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'inc
COMMIT
(3 rows)

-- Test that accessing a TOAST table is permitted during the decoding of a
-- prepared transaction.
-- Create a table with a column that uses a TOASTed default value.
-- (temporarily hide query, to avoid the long CREATE TABLE stmt)
\set ECHO none
BEGIN;
INSERT INTO test_tab VALUES('test');
PREPARE TRANSACTION 'test_toast_table_access';
SELECT count(*) FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0', 'skip-empty-xacts', '1', 'stream-changes', '1');
count
-------
3
(1 row)

COMMIT PREPARED 'test_toast_table_access';
-- consume commit prepared
SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0', 'skip-empty-xacts', '1', 'stream-changes', '1');
data
-------------------------------------------
COMMIT PREPARED 'test_toast_table_access'
(1 row)

-- Test 8:
-- cleanup and make sure results are also empty
DROP TABLE test_prepared1;
DROP TABLE test_prepared2;
DROP TABLE test_tab;
-- show results. There should be nothing to show
SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0', 'skip-empty-xacts', '1');
data
Expand Down
22 changes: 22 additions & 0 deletions contrib/test_decoding/sql/twophase.sql
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,32 @@ COMMIT PREPARED 'test_prepared_nodecode';
-- should be decoded now
SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0', 'skip-empty-xacts', '1');

-- Test that accessing a TOAST table is permitted during the decoding of a
-- prepared transaction.

-- Create a table with a column that uses a TOASTed default value.
-- (temporarily hide query, to avoid the long CREATE TABLE stmt)
\set ECHO none
SELECT 'CREATE TABLE test_tab (a text DEFAULT ''' || string_agg('toast value', '') || ''');' FROM generate_series(1, 4000)
\gexec
\set ECHO all

BEGIN;
INSERT INTO test_tab VALUES('test');
PREPARE TRANSACTION 'test_toast_table_access';

SELECT count(*) FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0', 'skip-empty-xacts', '1', 'stream-changes', '1');

COMMIT PREPARED 'test_toast_table_access';

-- consume commit prepared
SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0', 'skip-empty-xacts', '1', 'stream-changes', '1');

-- Test 8:
-- cleanup and make sure results are also empty
DROP TABLE test_prepared1;
DROP TABLE test_prepared2;
DROP TABLE test_tab;
-- show results. There should be nothing to show
SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0', 'skip-empty-xacts', '1');

Expand Down
4 changes: 2 additions & 2 deletions contrib/xml2/xpath.c
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ pgxml_xpath(text *document, xmlChar *xpath, xpath_workspace *workspace)
workspace->ctxt->node = xmlDocGetRootElement(workspace->doctree);

/* compile the path */
comppath = xmlXPathCompile(xpath);
comppath = xmlXPathCtxtCompile(workspace->ctxt, xpath);
if (comppath == NULL)
xml_ereport(xmlerrcxt, ERROR, ERRCODE_EXTERNAL_ROUTINE_EXCEPTION,
"XPath Syntax Error");
Expand Down Expand Up @@ -650,7 +650,7 @@ xpath_table(PG_FUNCTION_ARGS)
ctxt->node = xmlDocGetRootElement(doctree);

/* compile the path */
comppath = xmlXPathCompile(xpaths[j]);
comppath = xmlXPathCtxtCompile(ctxt, xpaths[j]);
if (comppath == NULL)
xml_ereport(xmlerrcxt, ERROR,
ERRCODE_EXTERNAL_ROUTINE_EXCEPTION,
Expand Down
15 changes: 9 additions & 6 deletions doc/src/sgml/config.sgml
Original file line number Diff line number Diff line change
Expand Up @@ -5226,8 +5226,9 @@ ANY <replaceable class="parameter">num_sync</replaceable> ( <replaceable class="
</term>
<listitem>
<para>
Enables or disables the query planner's use of index-scan plan
types. The default is <literal>on</literal>.
Enables or disables the query planner's use of index-scan and
index-only-scan plan types. The default is <literal>on</literal>.
Also see <xref linkend="guc-enable-indexonlyscan"/>.
</para>
</listitem>
</varlistentry>
Expand All @@ -5242,7 +5243,9 @@ ANY <replaceable class="parameter">num_sync</replaceable> ( <replaceable class="
<para>
Enables or disables the query planner's use of index-only-scan plan
types (see <xref linkend="indexes-index-only-scans"/>).
The default is <literal>on</literal>.
The default is <literal>on</literal>. The
<xref linkend="guc-enable-indexscan"/> setting must also be
enabled to have the query planner consider index-only-scans.
</para>
</listitem>
</varlistentry>
Expand Down Expand Up @@ -9573,9 +9576,9 @@ SET XML OPTION { DOCUMENT | CONTENT };
</term>
<listitem>
<para>
This variable specifies relation kind to which access is restricted.
It contains a comma-separated list of relation kind. Currently, the
supported relation kinds are <literal>view</literal> and
Set relation kinds for which access to non-system relations is prohibited.
The value takes the form of a comma-separated list of relation kinds.
Currently, the supported relation kinds are <literal>view</literal> and
<literal>foreign-table</literal>.
</para>
</listitem>
Expand Down
5 changes: 5 additions & 0 deletions doc/src/sgml/event-trigger.sgml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@
control statements are available to rewrite a table,
like <literal>CLUSTER</literal> and <literal>VACUUM</literal>,
the <literal>table_rewrite</literal> event is not triggered by them.
To find the OID of the table that was rewritten, use the function
<literal>pg_event_trigger_table_rewrite_oid()</literal> (see
<xref linkend="functions-event-triggers"/>). To discover the reason(s)
for the rewrite, use the function
<literal>pg_event_trigger_table_rewrite_reason()</literal>.
</para>

<para>
Expand Down
Loading
Loading