Skip to content

Commit 4bc61c4

Browse files
authored
Merge pull request #727 from bigplaice/sync_with_pg17
Sync with pg17.2
2 parents a4c028b + 68390dc commit 4bc61c4

312 files changed

Lines changed: 38722 additions & 26291 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

configure

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#! /bin/sh
22
# Guess values for system-dependent variables and create Makefiles.
3-
# Generated by GNU Autoconf 2.69 for PostgreSQL 17.0.
3+
# Generated by GNU Autoconf 2.69 for PostgreSQL 17.2.
44
#
55
# Report bugs to <[email protected]>.
66
#
@@ -582,8 +582,8 @@ MAKEFLAGS=
582582
# Identity of this package.
583583
PACKAGE_NAME='PostgreSQL'
584584
PACKAGE_TARNAME='postgresql'
585-
PACKAGE_VERSION='17.0'
586-
PACKAGE_STRING='PostgreSQL 17.0'
585+
PACKAGE_VERSION='17.2'
586+
PACKAGE_STRING='PostgreSQL 17.2'
587587
PACKAGE_BUGREPORT='[email protected]'
588588
PACKAGE_URL='https://www.postgresql.org/'
589589

@@ -1454,7 +1454,7 @@ if test "$ac_init_help" = "long"; then
14541454
# Omit some internal or obsolete options to make the list less imposing.
14551455
# This message is too long to be a string in the A/UX 3.1 sh.
14561456
cat <<_ACEOF
1457-
\`configure' configures PostgreSQL 17.0 to adapt to many kinds of systems.
1457+
\`configure' configures PostgreSQL 17.2 to adapt to many kinds of systems.
14581458

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

@@ -1519,7 +1519,7 @@ fi
15191519

15201520
if test -n "$ac_init_help"; then
15211521
case $ac_init_help in
1522-
short | recursive ) echo "Configuration of PostgreSQL 17.0:";;
1522+
short | recursive ) echo "Configuration of PostgreSQL 17.2:";;
15231523
esac
15241524
cat <<\_ACEOF
15251525

@@ -1698,7 +1698,7 @@ fi
16981698
test -n "$ac_init_help" && exit $ac_status
16991699
if $ac_init_version; then
17001700
cat <<\_ACEOF
1701-
PostgreSQL configure 17.0
1701+
PostgreSQL configure 17.2
17021702
generated by GNU Autoconf 2.69
17031703

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

2454-
It was created by PostgreSQL $as_me 17.0, which was
2454+
It was created by PostgreSQL $as_me 17.2, which was
24552455
generated by GNU Autoconf 2.69. Invocation command line was
24562456

24572457
$ $0 $@
@@ -2839,7 +2839,7 @@ cat >>confdefs.h <<_ACEOF
28392839
_ACEOF
28402840

28412841
# IvorySQL version
2842-
PACKAGE_IVORYSQL_VERSION='4.0'
2842+
PACKAGE_IVORYSQL_VERSION='4.2'
28432843

28442844
PG_MAJORVERSION=`expr "$PACKAGE_VERSION" : '\([0-9][0-9]*\)'`
28452845
PG_MINORVERSION=`expr "$PACKAGE_VERSION" : '.*\.\([0-9][0-9]*\)'`
@@ -19934,7 +19934,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
1993419934
# report actual input values of CONFIG_FILES etc. instead of their
1993519935
# values after options handling.
1993619936
ac_log="
19937-
This file was extended by PostgreSQL $as_me 17.0, which was
19937+
This file was extended by PostgreSQL $as_me 17.2, which was
1993819938
generated by GNU Autoconf 2.69. Invocation command line was
1993919939

1994019940
CONFIG_FILES = $CONFIG_FILES
@@ -20005,7 +20005,7 @@ _ACEOF
2000520005
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
2000620006
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
2000720007
ac_cs_version="\\
20008-
PostgreSQL config.status 17.0
20008+
PostgreSQL config.status 17.2
2000920009
configured by $0, generated by GNU Autoconf 2.69,
2001020010
with options \\"\$ac_cs_config\\"
2001120011

configure.ac

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ dnl Read the Autoconf manual for details.
1717
dnl
1818
m4_pattern_forbid(^PGAC_)dnl to catch undefined macros
1919

20-
AC_INIT([PostgreSQL], [17.0], [[email protected]], [], [https://www.postgresql.org/])
20+
AC_INIT([PostgreSQL], [17.2], [[email protected]], [], [https://www.postgresql.org/])
2121

2222
m4_if(m4_defn([m4_PACKAGE_VERSION]), [2.69], [], [m4_fatal([Autoconf version 2.69 is required.
2323
Untested combinations of 'autoconf' and PostgreSQL versions are not
@@ -30,7 +30,7 @@ AC_PREFIX_DEFAULT(/usr/local/pgsql)
3030
AC_DEFINE_UNQUOTED(CONFIGURE_ARGS, ["$ac_configure_args"], [Saved arguments from configure])
3131

3232
# IvorySQL version
33-
PACKAGE_IVORYSQL_VERSION='4.0'
33+
PACKAGE_IVORYSQL_VERSION='4.2'
3434

3535
[PG_MAJORVERSION=`expr "$PACKAGE_VERSION" : '\([0-9][0-9]*\)'`]
3636
[PG_MINORVERSION=`expr "$PACKAGE_VERSION" : '.*\.\([0-9][0-9]*\)'`]

contrib/bloom/blscan.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ blgetbitmap(IndexScanDesc scan, TIDBitmap *tbm)
121121
*/
122122
bas = GetAccessStrategy(BAS_BULKREAD);
123123
npages = RelationGetNumberOfBlocks(scan->indexRelation);
124+
pgstat_count_index_scan(scan->indexRelation);
124125

125126
for (blkno = BLOOM_HEAD_BLKNO; blkno < npages; blkno++)
126127
{

contrib/ivorysql_ora/src/merge/ora_merge.c

Lines changed: 42 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ IvyExecMergeMatched(ModifyTableContext *context, ResultRelInfo *resultRelInfo,
120120
{
121121
ModifyTableState *mtstate = context->mtstate;
122122
List **mergeActions = resultRelInfo->ri_MergeActions;
123+
ItemPointerData lockedtid;
123124
List *actionStates;
124125
TupleTableSlot *newslot = NULL;
125126
TupleTableSlot *rslot = NULL;
@@ -156,14 +157,32 @@ IvyExecMergeMatched(ModifyTableContext *context, ResultRelInfo *resultRelInfo,
156157
* target wholerow junk attr.
157158
*/
158159
Assert(tupleid != NULL || oldtuple != NULL);
160+
ItemPointerSetInvalid(&lockedtid);
159161
if (oldtuple != NULL)
162+
{
163+
Assert(!resultRelInfo->ri_needLockTagTuple);
160164
ExecForceStoreHeapTuple(oldtuple, resultRelInfo->ri_oldTupleSlot,
161165
false);
162-
else if (!table_tuple_fetch_row_version(resultRelInfo->ri_RelationDesc,
163-
tupleid,
164-
SnapshotAny,
165-
resultRelInfo->ri_oldTupleSlot))
166-
elog(ERROR, "failed to fetch the target tuple");
166+
}
167+
else
168+
{
169+
if (resultRelInfo->ri_needLockTagTuple)
170+
{
171+
/*
172+
* This locks even for CMD_DELETE, for CMD_NOTHING, and for tuples
173+
* that don't match mas_whenqual. MERGE on system catalogs is a
174+
* minor use case, so don't bother optimizing those.
175+
*/
176+
LockTuple(resultRelInfo->ri_RelationDesc, tupleid,
177+
InplaceUpdateTupleLock);
178+
lockedtid = *tupleid;
179+
}
180+
if (!table_tuple_fetch_row_version(resultRelInfo->ri_RelationDesc,
181+
tupleid,
182+
SnapshotAny,
183+
resultRelInfo->ri_oldTupleSlot))
184+
elog(ERROR, "failed to fetch the target tuple");
185+
}
167186

168187
/*
169188
* Test the join condition. If it's satisfied, perform a MATCHED action.
@@ -356,7 +375,7 @@ IvyExecMergeMatched(ModifyTableContext *context, ResultRelInfo *resultRelInfo,
356375
* let caller handle it under NOT MATCHED [BY TARGET] clauses.
357376
*/
358377
*matched = false;
359-
return NULL;
378+
goto out;
360379

361380
case TM_Updated:
362381
{
@@ -430,7 +449,7 @@ IvyExecMergeMatched(ModifyTableContext *context, ResultRelInfo *resultRelInfo,
430449
* more to do.
431450
*/
432451
if (TupIsNull(epqslot))
433-
return NULL;
452+
goto out;
434453

435454
/*
436455
* If we got a NULL ctid from the subplan, the
@@ -448,6 +467,15 @@ IvyExecMergeMatched(ModifyTableContext *context, ResultRelInfo *resultRelInfo,
448467
* we need to switch to the NOT MATCHED BY
449468
* SOURCE case.
450469
*/
470+
if (resultRelInfo->ri_needLockTagTuple)
471+
{
472+
if (ItemPointerIsValid(&lockedtid))
473+
UnlockTuple(resultRelInfo->ri_RelationDesc, &lockedtid,
474+
InplaceUpdateTupleLock);
475+
LockTuple(resultRelInfo->ri_RelationDesc, &context->tmfd.ctid,
476+
InplaceUpdateTupleLock);
477+
lockedtid = context->tmfd.ctid;
478+
}
451479
if (!table_tuple_fetch_row_version(resultRelationDesc,
452480
&context->tmfd.ctid,
453481
SnapshotAny,
@@ -476,7 +504,7 @@ IvyExecMergeMatched(ModifyTableContext *context, ResultRelInfo *resultRelInfo,
476504
* MATCHED [BY TARGET] actions
477505
*/
478506
*matched = false;
479-
return NULL;
507+
goto out;
480508

481509
case TM_SelfModified:
482510

@@ -504,13 +532,13 @@ IvyExecMergeMatched(ModifyTableContext *context, ResultRelInfo *resultRelInfo,
504532

505533
/* This shouldn't happen */
506534
elog(ERROR, "attempted to update or delete invisible tuple");
507-
return NULL;
535+
goto out;
508536

509537
default:
510538
/* see table_tuple_lock call in ExecDelete() */
511539
elog(ERROR, "unexpected table_tuple_lock status: %u",
512540
result);
513-
return NULL;
541+
goto out;
514542
}
515543
}
516544

@@ -557,6 +585,10 @@ IvyExecMergeMatched(ModifyTableContext *context, ResultRelInfo *resultRelInfo,
557585
/*
558586
* Successfully executed an action or no qualifying action was found.
559587
*/
588+
out:
589+
if (ItemPointerIsValid(&lockedtid))
590+
UnlockTuple(resultRelInfo->ri_RelationDesc, &lockedtid,
591+
InplaceUpdateTupleLock);
560592
return rslot;
561593
}
562594

contrib/pg_trgm/expected/ivy_pg_trgm.out

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2373,6 +2373,9 @@ ERROR: value 2025 out of bounds for option "siglen"
23732373
DETAIL: Valid values are between "1" and "2024".
23742374
create index trgm_idx on test_trgm using gist (t gist_trgm_ops(siglen=2024));
23752375
set enable_seqscan=off;
2376+
-- check index compatibility handling when opclass option is specified
2377+
alter table test_trgm alter column t type varchar(768);
2378+
alter table test_trgm alter column t type text;
23762379
select t,similarity(t,'qwertyu0988') as sml from test_trgm where t % 'qwertyu0988' order by sml desc, t;
23772380
t | sml
23782381
-------------+----------
@@ -3501,11 +3504,11 @@ select t,similarity(t,'gwertyu1988') as sml from test_trgm where t % 'gwertyu198
35013504

35023505
explain (costs off)
35033506
select t <-> 'q0987wertyu0988', t from test_trgm order by t <-> 'q0987wertyu0988' limit 2;
3504-
QUERY PLAN
3505-
-----------------------------------------------------------
3507+
QUERY PLAN
3508+
---------------------------------------------------
35063509
Limit
35073510
-> Index Scan using trgm_idx on test_trgm
3508-
Order By: ((t)::text <-> 'q0987wertyu0988'::text)
3511+
Order By: (t <-> 'q0987wertyu0988'::text)
35093512
(3 rows)
35103513

35113514
select t <-> 'q0987wertyu0988', t from test_trgm order by t <-> 'q0987wertyu0988' limit 2;
@@ -4659,13 +4662,13 @@ select count(*) from test_trgm where t ~ '[qwerty]{2}-?[qwerty]{2}';
46594662
-- check handling of indexquals that generate no searchable conditions
46604663
explain (costs off)
46614664
select count(*) from test_trgm where t like '%99%' and t like '%qwerty%';
4662-
QUERY PLAN
4663-
---------------------------------------------------------------------------------------------------------------------
4665+
QUERY PLAN
4666+
-----------------------------------------------------------------------------
46644667
Aggregate
46654668
-> Bitmap Heap Scan on test_trgm
4666-
Recheck Cond: (((t)::text ~~ '%99%'::text COLLATE "C") AND ((t)::text ~~ '%qwerty%'::text COLLATE "C"))
4669+
Recheck Cond: ((t ~~ '%99%'::text) AND (t ~~ '%qwerty%'::text))
46674670
-> Bitmap Index Scan on trgm_idx
4668-
Index Cond: (((t)::text ~~ '%99%'::text COLLATE "C") AND ((t)::text ~~ '%qwerty%'::text COLLATE "C"))
4671+
Index Cond: ((t ~~ '%99%'::text) AND (t ~~ '%qwerty%'::text))
46694672
(5 rows)
46704673

46714674
select count(*) from test_trgm where t like '%99%' and t like '%qwerty%';
@@ -4676,13 +4679,13 @@ select count(*) from test_trgm where t like '%99%' and t like '%qwerty%';
46764679

46774680
explain (costs off)
46784681
select count(*) from test_trgm where t like '%99%' and t like '%qw%';
4679-
QUERY PLAN
4680-
-----------------------------------------------------------------------------------------------------------------
4682+
QUERY PLAN
4683+
-------------------------------------------------------------------------
46814684
Aggregate
46824685
-> Bitmap Heap Scan on test_trgm
4683-
Recheck Cond: (((t)::text ~~ '%99%'::text COLLATE "C") AND ((t)::text ~~ '%qw%'::text COLLATE "C"))
4686+
Recheck Cond: ((t ~~ '%99%'::text) AND (t ~~ '%qw%'::text))
46844687
-> Bitmap Index Scan on trgm_idx
4685-
Index Cond: (((t)::text ~~ '%99%'::text COLLATE "C") AND ((t)::text ~~ '%qw%'::text COLLATE "C"))
4688+
Index Cond: ((t ~~ '%99%'::text) AND (t ~~ '%qw%'::text))
46864689
(5 rows)
46874690

46884691
select count(*) from test_trgm where t like '%99%' and t like '%qw%';

contrib/pg_trgm/expected/pg_trgm.out

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2372,6 +2372,9 @@ ERROR: value 2025 out of bounds for option "siglen"
23722372
DETAIL: Valid values are between "1" and "2024".
23732373
create index trgm_idx on test_trgm using gist (t gist_trgm_ops(siglen=2024));
23742374
set enable_seqscan=off;
2375+
-- check index compatibility handling when opclass option is specified
2376+
alter table test_trgm alter column t type varchar(768);
2377+
alter table test_trgm alter column t type text;
23752378
select t,similarity(t,'qwertyu0988') as sml from test_trgm where t % 'qwertyu0988' order by sml desc, t;
23762379
t | sml
23772380
-------------+----------

contrib/pg_trgm/sql/ivy_pg_trgm.sql

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ create index trgm_idx on test_trgm using gist (t gist_trgm_ops(siglen=2025));
5353
create index trgm_idx on test_trgm using gist (t gist_trgm_ops(siglen=2024));
5454
set enable_seqscan=off;
5555

56+
-- check index compatibility handling when opclass option is specified
57+
alter table test_trgm alter column t type varchar(768);
58+
alter table test_trgm alter column t type text;
59+
5660
select t,similarity(t,'qwertyu0988') as sml from test_trgm where t % 'qwertyu0988' order by sml desc, t;
5761
select t,similarity(t,'gwertyu0988') as sml from test_trgm where t % 'gwertyu0988' order by sml desc, t;
5862
select t,similarity(t,'gwertyu1988') as sml from test_trgm where t % 'gwertyu1988' order by sml desc, t;

contrib/pg_trgm/sql/pg_trgm.sql

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ create index trgm_idx on test_trgm using gist (t gist_trgm_ops(siglen=2025));
5252
create index trgm_idx on test_trgm using gist (t gist_trgm_ops(siglen=2024));
5353
set enable_seqscan=off;
5454

55+
-- check index compatibility handling when opclass option is specified
56+
alter table test_trgm alter column t type varchar(768);
57+
alter table test_trgm alter column t type text;
58+
5559
select t,similarity(t,'qwertyu0988') as sml from test_trgm where t % 'qwertyu0988' order by sml desc, t;
5660
select t,similarity(t,'gwertyu0988') as sml from test_trgm where t % 'gwertyu0988' order by sml desc, t;
5761
select t,similarity(t,'gwertyu1988') as sml from test_trgm where t % 'gwertyu1988' order by sml desc, t;

contrib/postgres_fdw/option.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,7 @@ process_pgfdw_appname(const char *appname)
522522
appendStringInfoString(&buf, application_name);
523523
break;
524524
case 'c':
525-
appendStringInfo(&buf, "%lx.%x", (long) (MyStartTime), MyProcPid);
525+
appendStringInfo(&buf, "%" INT64_MODIFIER "x.%x", MyStartTime, MyProcPid);
526526
break;
527527
case 'C':
528528
appendStringInfoString(&buf, cluster_name);

contrib/seg/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ PGFILEDESC = "seg - line segment data type"
1414

1515
HEADERS = segdata.h
1616

17-
REGRESS = security seg
18-
ORA_REGRESS = ivy_security ivy_seg
17+
REGRESS = security seg partition
18+
ORA_REGRESS = ivy_security ivy_seg ivy_partition
1919

2020
EXTRA_CLEAN = segparse.h segparse.c segscan.c
2121

0 commit comments

Comments
 (0)