Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit075ebc5

Browse files
authored
Merge branch 'postgres:master' into master
2 parents2609e19 +fc32be3 commit075ebc5

File tree

18 files changed

+284
-257
lines changed

18 files changed

+284
-257
lines changed

‎.git-blame-ignore-revs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
#
1515
# $ git log --pretty=format:"%H # %cd%n# %s" $PGINDENTGITHASH -1 --date=iso
1616

17+
4672b6223910687b2aab075bcd2dd54ce90d5171 # 2025-06-01 14:55:24 -0400
18+
# Run pgindent on the previous commit.
19+
1720
918e7287ed20eb1fe280ab6c4056ccf94dcd53a8 # 2025-04-30 19:18:30 +1200
1821
# Fix broken indentation
1922

‎contrib/btree_gist/btree_gist--1.7--1.8.sql

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -3,85 +3,85 @@
33
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
44
\echo Use"ALTER EXTENSION btree_gist UPDATE TO '1.8'" to load this file. \quit
55

6-
CREATEFUNCTIONgist_stratnum_btree(int)
6+
CREATEFUNCTIONgist_translate_cmptype_btree(int)
77
RETURNSsmallint
88
AS'MODULE_PATHNAME'
99
LANGUAGE C IMMUTABLE PARALLEL SAFE STRICT;
1010

1111
ALTEROPERATOR FAMILY gist_oid_ops USING gist ADD
12-
FUNCTION12 ("any","any")gist_stratnum_btree (int) ;
12+
FUNCTION12 ("any","any")gist_translate_cmptype_btree (int) ;
1313

1414
ALTEROPERATOR FAMILY gist_int2_ops USING gist ADD
15-
FUNCTION12 ("any","any")gist_stratnum_btree (int) ;
15+
FUNCTION12 ("any","any")gist_translate_cmptype_btree (int) ;
1616

1717
ALTEROPERATOR FAMILY gist_int4_ops USING gist ADD
18-
FUNCTION12 ("any","any")gist_stratnum_btree (int) ;
18+
FUNCTION12 ("any","any")gist_translate_cmptype_btree (int) ;
1919

2020
ALTEROPERATOR FAMILY gist_int8_ops USING gist ADD
21-
FUNCTION12 ("any","any")gist_stratnum_btree (int) ;
21+
FUNCTION12 ("any","any")gist_translate_cmptype_btree (int) ;
2222

2323
ALTEROPERATOR FAMILY gist_float4_ops USING gist ADD
24-
FUNCTION12 ("any","any")gist_stratnum_btree (int) ;
24+
FUNCTION12 ("any","any")gist_translate_cmptype_btree (int) ;
2525

2626
ALTEROPERATOR FAMILY gist_float8_ops USING gist ADD
27-
FUNCTION12 ("any","any")gist_stratnum_btree (int) ;
27+
FUNCTION12 ("any","any")gist_translate_cmptype_btree (int) ;
2828

2929
ALTEROPERATOR FAMILY gist_timestamp_ops USING gist ADD
30-
FUNCTION12 ("any","any")gist_stratnum_btree (int) ;
30+
FUNCTION12 ("any","any")gist_translate_cmptype_btree (int) ;
3131

3232
ALTEROPERATOR FAMILY gist_timestamptz_ops USING gist ADD
33-
FUNCTION12 ("any","any")gist_stratnum_btree (int) ;
33+
FUNCTION12 ("any","any")gist_translate_cmptype_btree (int) ;
3434

3535
ALTEROPERATOR FAMILY gist_time_ops USING gist ADD
36-
FUNCTION12 ("any","any")gist_stratnum_btree (int) ;
36+
FUNCTION12 ("any","any")gist_translate_cmptype_btree (int) ;
3737

3838
ALTEROPERATOR FAMILY gist_date_ops USING gist ADD
39-
FUNCTION12 ("any","any")gist_stratnum_btree (int) ;
39+
FUNCTION12 ("any","any")gist_translate_cmptype_btree (int) ;
4040

4141
ALTEROPERATOR FAMILY gist_interval_ops USING gist ADD
42-
FUNCTION12 ("any","any")gist_stratnum_btree (int) ;
42+
FUNCTION12 ("any","any")gist_translate_cmptype_btree (int) ;
4343

4444
ALTEROPERATOR FAMILY gist_cash_ops USING gist ADD
45-
FUNCTION12 ("any","any")gist_stratnum_btree (int) ;
45+
FUNCTION12 ("any","any")gist_translate_cmptype_btree (int) ;
4646

4747
ALTEROPERATOR FAMILY gist_macaddr_ops USING gist ADD
48-
FUNCTION12 ("any","any")gist_stratnum_btree (int) ;
48+
FUNCTION12 ("any","any")gist_translate_cmptype_btree (int) ;
4949

5050
ALTEROPERATOR FAMILY gist_text_ops USING gist ADD
51-
FUNCTION12 ("any","any")gist_stratnum_btree (int) ;
51+
FUNCTION12 ("any","any")gist_translate_cmptype_btree (int) ;
5252

5353
ALTEROPERATOR FAMILY gist_bpchar_ops USING gist ADD
54-
FUNCTION12 ("any","any")gist_stratnum_btree (int) ;
54+
FUNCTION12 ("any","any")gist_translate_cmptype_btree (int) ;
5555

5656
ALTEROPERATOR FAMILY gist_bytea_ops USING gist ADD
57-
FUNCTION12 ("any","any")gist_stratnum_btree (int) ;
57+
FUNCTION12 ("any","any")gist_translate_cmptype_btree (int) ;
5858

5959
ALTEROPERATOR FAMILY gist_numeric_ops USING gist ADD
60-
FUNCTION12 ("any","any")gist_stratnum_btree (int) ;
60+
FUNCTION12 ("any","any")gist_translate_cmptype_btree (int) ;
6161

6262
ALTEROPERATOR FAMILY gist_bit_ops USING gist ADD
63-
FUNCTION12 ("any","any")gist_stratnum_btree (int) ;
63+
FUNCTION12 ("any","any")gist_translate_cmptype_btree (int) ;
6464

6565
ALTEROPERATOR FAMILY gist_vbit_ops USING gist ADD
66-
FUNCTION12 ("any","any")gist_stratnum_btree (int) ;
66+
FUNCTION12 ("any","any")gist_translate_cmptype_btree (int) ;
6767

6868
ALTEROPERATOR FAMILY gist_inet_ops USING gist ADD
69-
FUNCTION12 ("any","any")gist_stratnum_btree (int) ;
69+
FUNCTION12 ("any","any")gist_translate_cmptype_btree (int) ;
7070

7171
ALTEROPERATOR FAMILY gist_cidr_ops USING gist ADD
72-
FUNCTION12 ("any","any")gist_stratnum_btree (int) ;
72+
FUNCTION12 ("any","any")gist_translate_cmptype_btree (int) ;
7373

7474
ALTEROPERATOR FAMILY gist_timetz_ops USING gist ADD
75-
FUNCTION12 ("any","any")gist_stratnum_btree (int) ;
75+
FUNCTION12 ("any","any")gist_translate_cmptype_btree (int) ;
7676

7777
ALTEROPERATOR FAMILY gist_uuid_ops USING gist ADD
78-
FUNCTION12 ("any","any")gist_stratnum_btree (int) ;
78+
FUNCTION12 ("any","any")gist_translate_cmptype_btree (int) ;
7979

8080
ALTEROPERATOR FAMILY gist_macaddr8_ops USING gist ADD
81-
FUNCTION12 ("any","any")gist_stratnum_btree (int) ;
81+
FUNCTION12 ("any","any")gist_translate_cmptype_btree (int) ;
8282

8383
ALTEROPERATOR FAMILY gist_enum_ops USING gist ADD
84-
FUNCTION12 ("any","any")gist_stratnum_btree (int) ;
84+
FUNCTION12 ("any","any")gist_translate_cmptype_btree (int) ;
8585

8686
ALTEROPERATOR FAMILY gist_bool_ops USING gist ADD
87-
FUNCTION12 ("any","any")gist_stratnum_btree (int) ;
87+
FUNCTION12 ("any","any")gist_translate_cmptype_btree (int) ;

‎contrib/btree_gist/btree_gist.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ PG_MODULE_MAGIC_EXT(
1515
PG_FUNCTION_INFO_V1(gbt_decompress);
1616
PG_FUNCTION_INFO_V1(gbtreekey_in);
1717
PG_FUNCTION_INFO_V1(gbtreekey_out);
18-
PG_FUNCTION_INFO_V1(gist_stratnum_btree);
18+
PG_FUNCTION_INFO_V1(gist_translate_cmptype_btree);
1919

2020
/**************************************************
2121
* In/Out for keys
@@ -62,7 +62,7 @@ gbt_decompress(PG_FUNCTION_ARGS)
6262
* Returns the btree number for supported operators, otherwise invalid.
6363
*/
6464
Datum
65-
gist_stratnum_btree(PG_FUNCTION_ARGS)
65+
gist_translate_cmptype_btree(PG_FUNCTION_ARGS)
6666
{
6767
CompareTypecmptype=PG_GETARG_INT32(0);
6868

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
-- test stratnum support func
2-
SELECTgist_stratnum_btree(7);
3-
gist_stratnum_btree
4-
---------------------
5-
0
1+
-- test stratnumtranslationsupport func
2+
SELECTgist_translate_cmptype_btree(7);
3+
gist_translate_cmptype_btree
4+
------------------------------
5+
0
66
(1 row)
77

8-
SELECTgist_stratnum_btree(3);
9-
gist_stratnum_btree
10-
---------------------
11-
3
8+
SELECTgist_translate_cmptype_btree(3);
9+
gist_translate_cmptype_btree
10+
------------------------------
11+
3
1212
(1 row)
1313

‎contrib/btree_gist/sql/stratnum.sql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
-- test stratnum support func
2-
SELECTgist_stratnum_btree(7);
3-
SELECTgist_stratnum_btree(3);
1+
-- test stratnumtranslationsupport func
2+
SELECTgist_translate_cmptype_btree(7);
3+
SELECTgist_translate_cmptype_btree(3);

‎doc/src/sgml/gist.sgml

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1170,7 +1170,7 @@ my_sortsupport(PG_FUNCTION_ARGS)
11701170
</varlistentry>
11711171

11721172
<varlistentry>
1173-
<term><function>stratnum</function></term>
1173+
<term><function>translate_cmptype</function></term>
11741174
<listitem>
11751175
<para>
11761176
Given a <literal>CompareType</literal> value from
@@ -1188,12 +1188,23 @@ my_sortsupport(PG_FUNCTION_ARGS)
11881188
non-<literal>WITHOUT OVERLAPS</literal> part(s) of an index constraint.
11891189
</para>
11901190

1191+
<para>
1192+
This support function corresponds to the index access method callback
1193+
function <structfield>amtranslatecmptype</structfield> (see <xref
1194+
linkend="index-functions"/>). The
1195+
<structfield>amtranslatecmptype</structfield> callback function for
1196+
GiST indexes merely calls down to the
1197+
<function>translate_cmptype</function> support function of the
1198+
respective operator family, since the GiST index access method has no
1199+
fixed strategy numbers itself.
1200+
</para>
1201+
11911202
<para>
11921203
The <acronym>SQL</acronym> declaration of the function must look like
11931204
this:
11941205

11951206
<programlisting>
1196-
CREATE OR REPLACE FUNCTIONmy_stratnum(integer)
1207+
CREATE OR REPLACE FUNCTIONmy_translate_cmptype(integer)
11971208
RETURNS smallint
11981209
AS 'MODULE_PATHNAME'
11991210
LANGUAGE C STRICT;
@@ -1202,18 +1213,18 @@ LANGUAGE C STRICT;
12021213
And the operator family registration must look like this:
12031214
<programlisting>
12041215
ALTER OPERATOR FAMILY my_opfamily USING gist ADD
1205-
FUNCTION 12 ("any", "any")my_stratnum(int);
1216+
FUNCTION 12 ("any", "any")my_translate_cmptype(int);
12061217
</programlisting>
12071218
</para>
12081219

12091220
<para>
12101221
The matching code in the C module could then follow this skeleton:
12111222

12121223
<programlisting>
1213-
PG_FUNCTION_INFO_V1(my_stratnum);
1224+
PG_FUNCTION_INFO_V1(my_translate_cmptype);
12141225

12151226
Datum
1216-
my_stratnum(PG_FUNCTION_ARGS)
1227+
my_translate_cmptype(PG_FUNCTION_ARGS)
12171228
{
12181229
CompareType cmptype = PG_GETARG_INT32(0);
12191230
StrategyNumber ret = InvalidStrategy;
@@ -1232,11 +1243,11 @@ my_stratnum(PG_FUNCTION_ARGS)
12321243
<para>
12331244
One translation function is provided by
12341245
<productname>PostgreSQL</productname>:
1235-
<literal>gist_stratnum_common</literal> is for operator classes that
1246+
<literal>gist_translate_cmptype_common</literal> is for operator classes that
12361247
use the <literal>RT*StrategyNumber</literal> constants.
12371248
The <literal>btree_gist</literal>
12381249
extension defines a second translation function,
1239-
<literal>gist_stratnum_btree</literal>, for operator classes that use
1250+
<literal>gist_translate_cmptype_btree</literal>, for operator classes that use
12401251
the <literal>BT*StrategyNumber</literal> constants.
12411252
</para>
12421253
</listitem>

‎doc/src/sgml/xindex.sgml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,7 @@
598598
<entry>11</entry>
599599
</row>
600600
<row>
601-
<entry><function>stratnum</function></entry>
601+
<entry><function>translate_cmptype</function></entry>
602602
<entry>translate compare types to strategy numbers
603603
used by the operator class (optional)</entry>
604604
<entry>12</entry>

‎src/backend/access/gist/gistutil.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1058,11 +1058,11 @@ gistGetFakeLSN(Relation rel)
10581058
}
10591059

10601060
/*
1061-
* This is a stratnum support function for GiST opclasses that use the
1062-
* RT*StrategyNumber constants.
1061+
* This is a stratnumtranslationsupport function for GiST opclasses that use
1062+
*theRT*StrategyNumber constants.
10631063
*/
10641064
Datum
1065-
gist_stratnum_common(PG_FUNCTION_ARGS)
1065+
gist_translate_cmptype_common(PG_FUNCTION_ARGS)
10661066
{
10671067
CompareTypecmptype=PG_GETARG_INT32(0);
10681068

@@ -1090,9 +1090,9 @@ gist_stratnum_common(PG_FUNCTION_ARGS)
10901090
/*
10911091
* Returns the opclass's private stratnum used for the given compare type.
10921092
*
1093-
* Calls the opclass'sGIST_STRATNUM_PROC support function, if any,
1094-
* and returns the result.
1095-
*Returns InvalidStrategy if the function is notdefined.
1093+
* Calls the opclass'sGIST_TRANSLATE_CMPTYPE_PROC support function, if any,
1094+
* and returns the result. Returns InvalidStrategy if the function is not
1095+
* defined.
10961096
*/
10971097
StrategyNumber
10981098
gisttranslatecmptype(CompareTypecmptype,Oidopfamily)
@@ -1101,7 +1101,7 @@ gisttranslatecmptype(CompareType cmptype, Oid opfamily)
11011101
Datumresult;
11021102

11031103
/* Check whether the function is provided. */
1104-
funcid=get_opfamily_proc(opfamily,ANYOID,ANYOID,GIST_STRATNUM_PROC);
1104+
funcid=get_opfamily_proc(opfamily,ANYOID,ANYOID,GIST_TRANSLATE_CMPTYPE_PROC);
11051105
if (!OidIsValid(funcid))
11061106
returnInvalidStrategy;
11071107

‎src/backend/access/gist/gistvalidate.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ gistvalidate(Oid opclassoid)
138138
ok=check_amproc_signature(procform->amproc,VOIDOID, true,
139139
1,1,INTERNALOID);
140140
break;
141-
caseGIST_STRATNUM_PROC:
141+
caseGIST_TRANSLATE_CMPTYPE_PROC:
142142
ok=check_amproc_signature(procform->amproc,INT2OID, true,
143143
1,1,INT4OID)&&
144144
procform->amproclefttype==ANYOID&&
@@ -265,7 +265,7 @@ gistvalidate(Oid opclassoid)
265265
if (i==GIST_DISTANCE_PROC||i==GIST_FETCH_PROC||
266266
i==GIST_COMPRESS_PROC||i==GIST_DECOMPRESS_PROC||
267267
i==GIST_OPTIONS_PROC||i==GIST_SORTSUPPORT_PROC||
268-
i==GIST_STRATNUM_PROC)
268+
i==GIST_TRANSLATE_CMPTYPE_PROC)
269269
continue;/* optional methods */
270270
ereport(INFO,
271271
(errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
@@ -336,7 +336,7 @@ gistadjustmembers(Oid opfamilyoid,
336336
caseGIST_FETCH_PROC:
337337
caseGIST_OPTIONS_PROC:
338338
caseGIST_SORTSUPPORT_PROC:
339-
caseGIST_STRATNUM_PROC:
339+
caseGIST_TRANSLATE_CMPTYPE_PROC:
340340
/* Optional, so force it to be a soft family dependency */
341341
op->ref_is_hard= false;
342342
op->ref_is_family= true;

‎src/backend/replication/walsender.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3449,8 +3449,16 @@ XLogSendLogical(void)
34493449
if (flushPtr==InvalidXLogRecPtr||
34503450
logical_decoding_ctx->reader->EndRecPtr >=flushPtr)
34513451
{
3452+
/*
3453+
* For cascading logical WAL senders, we use the replay LSN instead of
3454+
* the flush LSN, since logical decoding on a standby only processes
3455+
* WAL that has been replayed. This distinction becomes particularly
3456+
* important during shutdown, as new WAL is no longer replayed and the
3457+
* last replayed LSN marks the furthest point up to which decoding can
3458+
* proceed.
3459+
*/
34523460
if (am_cascading_walsender)
3453-
flushPtr=GetStandbyFlushRecPtr(NULL);
3461+
flushPtr=GetXLogReplayRecPtr(NULL);
34543462
else
34553463
flushPtr=GetFlushRecPtr(NULL);
34563464
}

‎src/backend/storage/aio/aio.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -752,7 +752,7 @@ pgaio_io_wait_for_free(void)
752752
{
753753
intreclaimed=0;
754754

755-
pgaio_debug(DEBUG2,"waiting for free IO with %d pending, %d in-flight, %d idle IOs",
755+
pgaio_debug(DEBUG2,"waiting for free IO with %d pending, %u in-flight, %u idle IOs",
756756
pgaio_my_backend->num_staged_ios,
757757
dclist_count(&pgaio_my_backend->in_flight_ios),
758758
dclist_count(&pgaio_my_backend->idle_ios));
@@ -797,7 +797,7 @@ pgaio_io_wait_for_free(void)
797797
if (dclist_count(&pgaio_my_backend->in_flight_ios)==0)
798798
ereport(ERROR,
799799
errmsg_internal("no free IOs despite no in-flight IOs"),
800-
errdetail_internal("%d pending, %d in-flight, %d idle IOs",
800+
errdetail_internal("%d pending, %u in-flight, %u idle IOs",
801801
pgaio_my_backend->num_staged_ios,
802802
dclist_count(&pgaio_my_backend->in_flight_ios),
803803
dclist_count(&pgaio_my_backend->idle_ios)));
@@ -828,7 +828,7 @@ pgaio_io_wait_for_free(void)
828828
casePGAIO_HS_COMPLETED_IO:
829829
casePGAIO_HS_SUBMITTED:
830830
pgaio_debug_io(DEBUG2,ioh,
831-
"waiting for free io with %d in flight",
831+
"waiting for free io with %u in flight",
832832
dclist_count(&pgaio_my_backend->in_flight_ios));
833833

834834
/*
@@ -1252,7 +1252,7 @@ pgaio_closing_fd(int fd)
12521252
break;
12531253

12541254
pgaio_debug_io(DEBUG2,ioh,
1255-
"waiting for IO before FD %d gets closed, %d in-flight IOs",
1255+
"waiting for IO before FD %d gets closed, %u in-flight IOs",
12561256
fd,dclist_count(&pgaio_my_backend->in_flight_ios));
12571257

12581258
/* see comment in pgaio_io_wait_for_free() about raciness */
@@ -1288,7 +1288,7 @@ pgaio_shutdown(int code, Datum arg)
12881288
uint64generation=ioh->generation;
12891289

12901290
pgaio_debug_io(DEBUG2,ioh,
1291-
"waiting for IO to complete during shutdown, %d in-flight IOs",
1291+
"waiting for IO to complete during shutdown, %u in-flight IOs",
12921292
dclist_count(&pgaio_my_backend->in_flight_ios));
12931293

12941294
/* see comment in pgaio_io_wait_for_free() about raciness */

‎src/include/access/gist.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
#defineGIST_FETCH_PROC9
4141
#defineGIST_OPTIONS_PROC10
4242
#defineGIST_SORTSUPPORT_PROC11
43-
#defineGIST_STRATNUM_PROC12
43+
#defineGIST_TRANSLATE_CMPTYPE_PROC12
4444
#defineGISTNProcs12
4545

4646
/*

‎src/include/catalog/catversion.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,6 @@
5757
*/
5858

5959
/*yyyymmddN */
60-
#defineCATALOG_VERSION_NO202505071
60+
#defineCATALOG_VERSION_NO202506021
6161

6262
#endif

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp