Move "number of chunks" to TOAST message
authorChristoph Berg <[email protected]>
Fri, 7 Jun 2024 11:32:55 +0000 (13:32 +0200)
committerChristoph Berg <[email protected]>
Fri, 7 Jun 2024 11:34:47 +0000 (13:34 +0200)
No reason to waste two separate lines on this.

decode.c
expected/toast.out

index 7446bd52e4df86048c4d7798ec9968c5033f47c2..37f723f658b51084c8468777291bb6b75fd32421 100644 (file)
--- a/decode.c
+++ b/decode.c
@@ -1382,16 +1382,15 @@ ReadStringFromToast(const char *buffer,
 #else
                toast_ext_size = toast_ptr.va_extsize;
 #endif
+               num_chunks = (toast_ext_size - 1) / TOAST_MAX_CHUNK_SIZE + 1;
 
                printf("  TOAST value. Raw size: %8d, external size: %8d, "
-                               "value id: %6d, toast relation id: %6d\n",
+                               "value id: %6d, toast relation id: %6d, chunks: %6d\n",
                                toast_ptr.va_rawsize,
                                toast_ext_size,
                                toast_ptr.va_valueid,
-                               toast_ptr.va_toastrelid);
-
-               num_chunks = (toast_ext_size - 1) / TOAST_MAX_CHUNK_SIZE + 1;
-               printf("  Number of chunks: %d\n", num_chunks);
+                               toast_ptr.va_toastrelid,
+                               num_chunks);
 
                /* Open TOAST relation file */
                toast_relation_path = strdup(fileName);
index 084abb42e8248ff3106bf0452385fd91d9a7afec..94f2f4ec05c8c56925538388d703f45cab920c0f 100644 (file)
@@ -86,21 +86,17 @@ COPY: short inline  xxx
  Item   2 -- Length:  256  Offset: 7888 (0x1ed0)  Flags: NORMAL
 COPY: long inline uncompressed xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  Item   3 -- Length:   64  Offset: 7824 (0x1e90)  Flags: NORMAL
-  TOAST value. Raw size:     2804, external size:     2800, value id:  ....., toast relation id:  .....
-  Number of chunks: 2
+  TOAST value. Raw size:     2804, external size:     2800, value id:  ....., toast relation id:  ....., chunks:      2
 COPY: external uncompressed    0123456789
  Item   4 -- Length:  107  Offset: 7712 (0x1e20)  Flags: NORMAL
 COPY: inline compressed pglz   0123456789
  Item   5 -- Length:   67  Offset: 7640 (0x1dd8)  Flags: NORMAL
-  TOAST value. Raw size:   280004, external size:     3226, value id:  ....., toast relation id:  .....
-  Number of chunks: 2
+  TOAST value. Raw size:   280004, external size:     3226, value id:  ....., toast relation id:  ....., chunks:      2
 COPY: extended compressed pglz 0123456789
  Item   6 -- Length:   90  Offset: 7544 (0x1d78)  Flags: NORMAL
 COPY: inline compressed lz4    0123456789
  Item   7 -- Length:   66  Offset: 7472 (0x1d30)  Flags: NORMAL
-  TOAST value. Raw size:   700004, external size:     2772, value id:  ....., toast relation id:  .....
-  Number of chunks: 2
-
+  TOAST value. Raw size:   700004, external size:     2772, value id:  ....., toast relation id:  ....., chunks:      2
 COPY: extended compressed lz4  0123456789