]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Fix order of columns in pg_stat_recovery
authorMichael Paquier <michael@paquier.xyz>
Fri, 6 Mar 2026 05:41:41 +0000 (14:41 +0900)
committerMichael Paquier <michael@paquier.xyz>
Fri, 6 Mar 2026 05:41:41 +0000 (14:41 +0900)
recovery_last_xact_time is listed before current_chunk_start_time in the
documentation, the function definition and the view definition, but
their order was reversed in the code.

Thinko in 01d485b142e4.  Mea culpa.

Author: Shinya Kato <shinya11.kato@gmail.com>
Discussion: https://postgr.es/m/CAOzEurQQ1naKmPJhfE5WOUQjtf5tu08Kw3QCGY5UY=7Rt9fE=w@mail.gmail.com

src/backend/access/transam/xlogfuncs.c

index 7c0e430b690939e07dc9db84aac3bb0418ed2ddd..800077830675025873ef980e661154c0e0f22afd 100644 (file)
@@ -842,14 +842,13 @@ pg_stat_get_recovery(PG_FUNCTION_ARGS)
        else
                nulls[5] = true;
 
-       if (current_chunk_start_time != 0)
-               values[6] = TimestampTzGetDatum(current_chunk_start_time);
+       if (recovery_last_xact_time != 0)
+               values[6] = TimestampTzGetDatum(recovery_last_xact_time);
        else
                nulls[6] = true;
 
-       /* recovery_last_xact_time */
-       if (recovery_last_xact_time != 0)
-               values[7] = TimestampTzGetDatum(recovery_last_xact_time);
+       if (current_chunk_start_time != 0)
+               values[7] = TimestampTzGetDatum(current_chunk_start_time);
        else
                nulls[7] = true;