1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988
|
-- 64 bit output in *.out, 32 bit output in *_3.out
select oid as datoid from pg_database where datname = current_database() \gset
----------------------------------------------------------------------------------------------
create table "int,text" (i int, t text);
insert into "int,text" values (1, 'one'), (null, 'two'), (3, null), (4, 'four');
\set relname int,text
\ir run_test.sql
\echo Testing :relname
Testing int,text
vacuum :"relname";
checkpoint;
select relfilenode from pg_class where relname = :'relname' \gset
select lo_import(format('base/%s/%s', :'datoid', :'relfilenode')) as oid \gset
\set output :relname '.heap'
\lo_export :oid :output
\setenv relname :relname
\! pg_filedump -D $relname $relname.heap | ./sed.sh
*******************************************************************
* PostgreSQL File/Block Formatted Dump Utility
*
* File: int,text.heap
* Options used: -D int,text
*******************************************************************
Block 0 ********************************************************
<Header> -----
Block Offset: 0x00000000 Offsets: Lower 40 (0x0028)
Block: Size 8192 Version 4 Upper 8068 (0x1f84)
LSN: logid ...... recoff 0x........ Special 8192 (0x2000)
Items: 4 Free Space: 8028
Checksum: 0x.... Prune XID: 0x00000000 Flags: 0x0004 (ALL_VISIBLE)
Length (including item array): 40
<Data> -----
Item 1 -- Length: 32 Offset: 8160 (0x1fe0) Flags: NORMAL
COPY: 1 one
Item 2 -- Length: 28 Offset: 8132 (0x1fc4) Flags: NORMAL
COPY: \N two
Item 3 -- Length: 28 Offset: 8104 (0x1fa8) Flags: NORMAL
COPY: 3 \N
Item 4 -- Length: 33 Offset: 8068 (0x1f84) Flags: NORMAL
COPY: 4 four
*** End of File Encountered. Last Block Read: 0 ***
--
----------------------------------------------------------------------------------------------
--
-- do one test without options
\! pg_filedump int,text.heap | ./sed.sh
*******************************************************************
* PostgreSQL File/Block Formatted Dump Utility
*
* File: int,text.heap
* Options used: None
*******************************************************************
Block 0 ********************************************************
<Header> -----
Block Offset: 0x00000000 Offsets: Lower 40 (0x0028)
Block: Size 8192 Version 4 Upper 8068 (0x1f84)
LSN: logid ...... recoff 0x........ Special 8192 (0x2000)
Items: 4 Free Space: 8028
Checksum: 0x.... Prune XID: 0x00000000 Flags: 0x0004 (ALL_VISIBLE)
Length (including item array): 40
<Data> -----
Item 1 -- Length: 32 Offset: 8160 (0x1fe0) Flags: NORMAL
Item 2 -- Length: 28 Offset: 8132 (0x1fc4) Flags: NORMAL
Item 3 -- Length: 28 Offset: 8104 (0x1fa8) Flags: NORMAL
Item 4 -- Length: 33 Offset: 8068 (0x1f84) Flags: NORMAL
*** End of File Encountered. Last Block Read: 0 ***
----------------------------------------------------------------------------------------------
create table bigint (x bigint);
insert into bigint values (-1), (0), (1), (null);
\set relname bigint
\ir run_test.sql
\echo Testing :relname
Testing bigint
vacuum :"relname";
checkpoint;
select relfilenode from pg_class where relname = :'relname' \gset
select lo_import(format('base/%s/%s', :'datoid', :'relfilenode')) as oid \gset
\set output :relname '.heap'
\lo_export :oid :output
\setenv relname :relname
\! pg_filedump -D $relname $relname.heap | ./sed.sh
*******************************************************************
* PostgreSQL File/Block Formatted Dump Utility
*
* File: bigint.heap
* Options used: -D bigint
*******************************************************************
Block 0 ********************************************************
<Header> -----
Block Offset: 0x00000000 Offsets: Lower 40 (0x0028)
Block: Size 8192 Version 4 Upper 8072 (0x1f88)
LSN: logid ...... recoff 0x........ Special 8192 (0x2000)
Items: 4 Free Space: 8032
Checksum: 0x.... Prune XID: 0x00000000 Flags: 0x0004 (ALL_VISIBLE)
Length (including item array): 40
<Data> -----
Item 1 -- Length: 32 Offset: 8160 (0x1fe0) Flags: NORMAL
COPY: -1
Item 2 -- Length: 32 Offset: 8128 (0x1fc0) Flags: NORMAL
COPY: 0
Item 3 -- Length: 32 Offset: 8096 (0x1fa0) Flags: NORMAL
COPY: 1
Item 4 -- Length: 24 Offset: 8072 (0x1f88) Flags: NORMAL
COPY: \N
*** End of File Encountered. Last Block Read: 0 ***
--
----------------------------------------------------------------------------------------------
--
create table bool (x bool);
insert into bool values (true), (false), (null);
\set relname bool
\ir run_test.sql
\echo Testing :relname
Testing bool
vacuum :"relname";
checkpoint;
select relfilenode from pg_class where relname = :'relname' \gset
select lo_import(format('base/%s/%s', :'datoid', :'relfilenode')) as oid \gset
\set output :relname '.heap'
\lo_export :oid :output
\setenv relname :relname
\! pg_filedump -D $relname $relname.heap | ./sed.sh
*******************************************************************
* PostgreSQL File/Block Formatted Dump Utility
*
* File: bool.heap
* Options used: -D bool
*******************************************************************
Block 0 ********************************************************
<Header> -----
Block Offset: 0x00000000 Offsets: Lower 36 (0x0024)
Block: Size 8192 Version 4 Upper 8112 (0x1fb0)
LSN: logid ...... recoff 0x........ Special 8192 (0x2000)
Items: 3 Free Space: 8076
Checksum: 0x.... Prune XID: 0x00000000 Flags: 0x0004 (ALL_VISIBLE)
Length (including item array): 36
<Data> -----
Item 1 -- Length: 25 Offset: 8164 (0x1fe4) Flags: NORMAL
COPY: t
Item 2 -- Length: 25 Offset: 8136 (0x1fc8) Flags: NORMAL
COPY: f
Item 3 -- Length: 24 Offset: 8112 (0x1fb0) Flags: NORMAL
COPY: \N
*** End of File Encountered. Last Block Read: 0 ***
--
----------------------------------------------------------------------------------------------
--
create table char (x "char");
insert into char values ('x'), (null);
\set relname char
\ir run_test.sql
\echo Testing :relname
Testing char
vacuum :"relname";
checkpoint;
select relfilenode from pg_class where relname = :'relname' \gset
select lo_import(format('base/%s/%s', :'datoid', :'relfilenode')) as oid \gset
\set output :relname '.heap'
\lo_export :oid :output
\setenv relname :relname
\! pg_filedump -D $relname $relname.heap | ./sed.sh
*******************************************************************
* PostgreSQL File/Block Formatted Dump Utility
*
* File: char.heap
* Options used: -D char
*******************************************************************
Block 0 ********************************************************
<Header> -----
Block Offset: 0x00000000 Offsets: Lower 32 (0x0020)
Block: Size 8192 Version 4 Upper 8140 (0x1fcc)
LSN: logid ...... recoff 0x........ Special 8192 (0x2000)
Items: 2 Free Space: 8108
Checksum: 0x.... Prune XID: 0x00000000 Flags: 0x0004 (ALL_VISIBLE)
Length (including item array): 32
<Data> -----
Item 1 -- Length: 25 Offset: 8164 (0x1fe4) Flags: NORMAL
COPY: x
Item 2 -- Length: 24 Offset: 8140 (0x1fcc) Flags: NORMAL
COPY: \N
*** End of File Encountered. Last Block Read: 0 ***
--
----------------------------------------------------------------------------------------------
--
create table "charN" (x char(5));
insert into "charN" values ('x'), ('xxxxx'), (null);
\set relname charN
\ir run_test.sql
\echo Testing :relname
Testing charN
vacuum :"relname";
checkpoint;
select relfilenode from pg_class where relname = :'relname' \gset
select lo_import(format('base/%s/%s', :'datoid', :'relfilenode')) as oid \gset
\set output :relname '.heap'
\lo_export :oid :output
\setenv relname :relname
\! pg_filedump -D $relname $relname.heap | ./sed.sh
*******************************************************************
* PostgreSQL File/Block Formatted Dump Utility
*
* File: charN.heap
* Options used: -D charN
*******************************************************************
Block 0 ********************************************************
<Header> -----
Block Offset: 0x00000000 Offsets: Lower 36 (0x0024)
Block: Size 8192 Version 4 Upper 8104 (0x1fa8)
LSN: logid ...... recoff 0x........ Special 8192 (0x2000)
Items: 3 Free Space: 8068
Checksum: 0x.... Prune XID: 0x00000000 Flags: 0x0004 (ALL_VISIBLE)
Length (including item array): 36
<Data> -----
Item 1 -- Length: 30 Offset: 8160 (0x1fe0) Flags: NORMAL
COPY: x
Item 2 -- Length: 30 Offset: 8128 (0x1fc0) Flags: NORMAL
COPY: xxxxx
Item 3 -- Length: 24 Offset: 8104 (0x1fa8) Flags: NORMAL
COPY: \N
*** End of File Encountered. Last Block Read: 0 ***
--
----------------------------------------------------------------------------------------------
--
create table date (x date);
insert into date values ('2000-01-01'), ('1900-02-02'), ('2100-12-31'), ('100-01-01 BC'), ('-infinity'), ('infinity'), (null);
\set relname date
\ir run_test.sql
\echo Testing :relname
Testing date
vacuum :"relname";
checkpoint;
select relfilenode from pg_class where relname = :'relname' \gset
select lo_import(format('base/%s/%s', :'datoid', :'relfilenode')) as oid \gset
\set output :relname '.heap'
\lo_export :oid :output
\setenv relname :relname
\! pg_filedump -D $relname $relname.heap | ./sed.sh
*******************************************************************
* PostgreSQL File/Block Formatted Dump Utility
*
* File: date.heap
* Options used: -D date
*******************************************************************
Block 0 ********************************************************
<Header> -----
Block Offset: 0x00000000 Offsets: Lower 52 (0x0034)
Block: Size 8192 Version 4 Upper 8000 (0x1f40)
LSN: logid ...... recoff 0x........ Special 8192 (0x2000)
Items: 7 Free Space: 7948
Checksum: 0x.... Prune XID: 0x00000000 Flags: 0x0004 (ALL_VISIBLE)
Length (including item array): 52
<Data> -----
Item 1 -- Length: 28 Offset: 8164 (0x1fe4) Flags: NORMAL
COPY: 2000-01-01
Item 2 -- Length: 28 Offset: 8136 (0x1fc8) Flags: NORMAL
COPY: 1900-02-02
Item 3 -- Length: 28 Offset: 8108 (0x1fac) Flags: NORMAL
COPY: 2100-12-31
Item 4 -- Length: 28 Offset: 8080 (0x1f90) Flags: NORMAL
COPY: 0100-01-01 BC
Item 5 -- Length: 28 Offset: 8052 (0x1f74) Flags: NORMAL
COPY: -infinity
Item 6 -- Length: 28 Offset: 8024 (0x1f58) Flags: NORMAL
COPY: infinity
Item 7 -- Length: 24 Offset: 8000 (0x1f40) Flags: NORMAL
COPY: \N
*** End of File Encountered. Last Block Read: 0 ***
--
----------------------------------------------------------------------------------------------
--
create table int (x int);
insert into int values (-1), (0), (1), (null);
\set relname int
\ir run_test.sql
\echo Testing :relname
Testing int
vacuum :"relname";
checkpoint;
select relfilenode from pg_class where relname = :'relname' \gset
select lo_import(format('base/%s/%s', :'datoid', :'relfilenode')) as oid \gset
\set output :relname '.heap'
\lo_export :oid :output
\setenv relname :relname
\! pg_filedump -D $relname $relname.heap | ./sed.sh
*******************************************************************
* PostgreSQL File/Block Formatted Dump Utility
*
* File: int.heap
* Options used: -D int
*******************************************************************
Block 0 ********************************************************
<Header> -----
Block Offset: 0x00000000 Offsets: Lower 40 (0x0028)
Block: Size 8192 Version 4 Upper 8084 (0x1f94)
LSN: logid ...... recoff 0x........ Special 8192 (0x2000)
Items: 4 Free Space: 8044
Checksum: 0x.... Prune XID: 0x00000000 Flags: 0x0004 (ALL_VISIBLE)
Length (including item array): 40
<Data> -----
Item 1 -- Length: 28 Offset: 8164 (0x1fe4) Flags: NORMAL
COPY: -1
Item 2 -- Length: 28 Offset: 8136 (0x1fc8) Flags: NORMAL
COPY: 0
Item 3 -- Length: 28 Offset: 8108 (0x1fac) Flags: NORMAL
COPY: 1
Item 4 -- Length: 24 Offset: 8084 (0x1f94) Flags: NORMAL
COPY: \N
*** End of File Encountered. Last Block Read: 0 ***
--
----------------------------------------------------------------------------------------------
--
create table json (x json);
insert into json values ('1'), ('"one"'), ('{"a":"b"}'), ('null'), (null);
\set relname json
\ir run_test.sql
\echo Testing :relname
Testing json
vacuum :"relname";
checkpoint;
select relfilenode from pg_class where relname = :'relname' \gset
select lo_import(format('base/%s/%s', :'datoid', :'relfilenode')) as oid \gset
\set output :relname '.heap'
\lo_export :oid :output
\setenv relname :relname
\! pg_filedump -D $relname $relname.heap | ./sed.sh
*******************************************************************
* PostgreSQL File/Block Formatted Dump Utility
*
* File: json.heap
* Options used: -D json
*******************************************************************
Block 0 ********************************************************
<Header> -----
Block Offset: 0x00000000 Offsets: Lower 44 (0x002c)
Block: Size 8192 Version 4 Upper 8040 (0x1f68)
LSN: logid ...... recoff 0x........ Special 8192 (0x2000)
Items: 5 Free Space: 7996
Checksum: 0x.... Prune XID: 0x00000000 Flags: 0x0004 (ALL_VISIBLE)
Length (including item array): 44
<Data> -----
Item 1 -- Length: 26 Offset: 8164 (0x1fe4) Flags: NORMAL
COPY: 1
Item 2 -- Length: 30 Offset: 8132 (0x1fc4) Flags: NORMAL
COPY: "one"
Item 3 -- Length: 34 Offset: 8096 (0x1fa0) Flags: NORMAL
COPY: {"a":"b"}
Item 4 -- Length: 29 Offset: 8064 (0x1f80) Flags: NORMAL
COPY: null
Item 5 -- Length: 24 Offset: 8040 (0x1f68) Flags: NORMAL
COPY: \N
*** End of File Encountered. Last Block Read: 0 ***
--
----------------------------------------------------------------------------------------------
--
create table macaddr (x macaddr);
insert into macaddr values ('00:10:20:30:40:50'), (null);
\set relname macaddr
\ir run_test.sql
\echo Testing :relname
Testing macaddr
vacuum :"relname";
checkpoint;
select relfilenode from pg_class where relname = :'relname' \gset
select lo_import(format('base/%s/%s', :'datoid', :'relfilenode')) as oid \gset
\set output :relname '.heap'
\lo_export :oid :output
\setenv relname :relname
\! pg_filedump -D $relname $relname.heap | ./sed.sh
*******************************************************************
* PostgreSQL File/Block Formatted Dump Utility
*
* File: macaddr.heap
* Options used: -D macaddr
*******************************************************************
Block 0 ********************************************************
<Header> -----
Block Offset: 0x00000000 Offsets: Lower 32 (0x0020)
Block: Size 8192 Version 4 Upper 8136 (0x1fc8)
LSN: logid ...... recoff 0x........ Special 8192 (0x2000)
Items: 2 Free Space: 8104
Checksum: 0x.... Prune XID: 0x00000000 Flags: 0x0004 (ALL_VISIBLE)
Length (including item array): 32
<Data> -----
Item 1 -- Length: 30 Offset: 8160 (0x1fe0) Flags: NORMAL
COPY: 00:10:20:30:40:50
Item 2 -- Length: 24 Offset: 8136 (0x1fc8) Flags: NORMAL
COPY: \N
*** End of File Encountered. Last Block Read: 0 ***
--
----------------------------------------------------------------------------------------------
--
create table name (x name);
insert into name values ('name'), ('1234567890123456789012345678901234567890123456789012345678901234567890'), (null);
\set relname name
\ir run_test.sql
\echo Testing :relname
Testing name
vacuum :"relname";
checkpoint;
select relfilenode from pg_class where relname = :'relname' \gset
select lo_import(format('base/%s/%s', :'datoid', :'relfilenode')) as oid \gset
\set output :relname '.heap'
\lo_export :oid :output
\setenv relname :relname
\! pg_filedump -D $relname $relname.heap | ./sed.sh
*******************************************************************
* PostgreSQL File/Block Formatted Dump Utility
*
* File: name.heap
* Options used: -D name
*******************************************************************
Block 0 ********************************************************
<Header> -----
Block Offset: 0x00000000 Offsets: Lower 36 (0x0024)
Block: Size 8192 Version 4 Upper 7992 (0x1f38)
LSN: logid ...... recoff 0x........ Special 8192 (0x2000)
Items: 3 Free Space: 7956
Checksum: 0x.... Prune XID: 0x00000000 Flags: 0x0004 (ALL_VISIBLE)
Length (including item array): 36
<Data> -----
Item 1 -- Length: 88 Offset: 8104 (0x1fa8) Flags: NORMAL
COPY: name
Item 2 -- Length: 88 Offset: 8016 (0x1f50) Flags: NORMAL
COPY: 123456789012345678901234567890123456789012345678901234567890123
Item 3 -- Length: 24 Offset: 7992 (0x1f38) Flags: NORMAL
COPY: \N
*** End of File Encountered. Last Block Read: 0 ***
--
----------------------------------------------------------------------------------------------
--
create table oid (x oid);
insert into oid values (-1), (0), (1), (null);
\set relname oid
\ir run_test.sql
\echo Testing :relname
Testing oid
vacuum :"relname";
checkpoint;
select relfilenode from pg_class where relname = :'relname' \gset
select lo_import(format('base/%s/%s', :'datoid', :'relfilenode')) as oid \gset
\set output :relname '.heap'
\lo_export :oid :output
\setenv relname :relname
\! pg_filedump -D $relname $relname.heap | ./sed.sh
*******************************************************************
* PostgreSQL File/Block Formatted Dump Utility
*
* File: oid.heap
* Options used: -D oid
*******************************************************************
Block 0 ********************************************************
<Header> -----
Block Offset: 0x00000000 Offsets: Lower 40 (0x0028)
Block: Size 8192 Version 4 Upper 8084 (0x1f94)
LSN: logid ...... recoff 0x........ Special 8192 (0x2000)
Items: 4 Free Space: 8044
Checksum: 0x.... Prune XID: 0x00000000 Flags: 0x0004 (ALL_VISIBLE)
Length (including item array): 40
<Data> -----
Item 1 -- Length: 28 Offset: 8164 (0x1fe4) Flags: NORMAL
COPY: 4294967295
Item 2 -- Length: 28 Offset: 8136 (0x1fc8) Flags: NORMAL
COPY: 0
Item 3 -- Length: 28 Offset: 8108 (0x1fac) Flags: NORMAL
COPY: 1
Item 4 -- Length: 24 Offset: 8084 (0x1f94) Flags: NORMAL
COPY: \N
*** End of File Encountered. Last Block Read: 0 ***
--
----------------------------------------------------------------------------------------------
--
create table smallint (x smallint);
insert into smallint values (-1), (0), (1), (null);
\set relname smallint
\ir run_test.sql
\echo Testing :relname
Testing smallint
vacuum :"relname";
checkpoint;
select relfilenode from pg_class where relname = :'relname' \gset
select lo_import(format('base/%s/%s', :'datoid', :'relfilenode')) as oid \gset
\set output :relname '.heap'
\lo_export :oid :output
\setenv relname :relname
\! pg_filedump -D $relname $relname.heap | ./sed.sh
*******************************************************************
* PostgreSQL File/Block Formatted Dump Utility
*
* File: smallint.heap
* Options used: -D smallint
*******************************************************************
Block 0 ********************************************************
<Header> -----
Block Offset: 0x00000000 Offsets: Lower 40 (0x0028)
Block: Size 8192 Version 4 Upper 8084 (0x1f94)
LSN: logid ...... recoff 0x........ Special 8192 (0x2000)
Items: 4 Free Space: 8044
Checksum: 0x.... Prune XID: 0x00000000 Flags: 0x0004 (ALL_VISIBLE)
Length (including item array): 40
<Data> -----
Item 1 -- Length: 26 Offset: 8164 (0x1fe4) Flags: NORMAL
COPY: -1
Item 2 -- Length: 26 Offset: 8136 (0x1fc8) Flags: NORMAL
COPY: 0
Item 3 -- Length: 26 Offset: 8108 (0x1fac) Flags: NORMAL
COPY: 1
Item 4 -- Length: 24 Offset: 8084 (0x1f94) Flags: NORMAL
COPY: \N
*** End of File Encountered. Last Block Read: 0 ***
--
----------------------------------------------------------------------------------------------
--
create table text (x text);
insert into text values ('hello world'), (null);
\set relname text
\ir run_test.sql
\echo Testing :relname
Testing text
vacuum :"relname";
checkpoint;
select relfilenode from pg_class where relname = :'relname' \gset
select lo_import(format('base/%s/%s', :'datoid', :'relfilenode')) as oid \gset
\set output :relname '.heap'
\lo_export :oid :output
\setenv relname :relname
\! pg_filedump -D $relname $relname.heap | ./sed.sh
*******************************************************************
* PostgreSQL File/Block Formatted Dump Utility
*
* File: text.heap
* Options used: -D text
*******************************************************************
Block 0 ********************************************************
<Header> -----
Block Offset: 0x00000000 Offsets: Lower 32 (0x0020)
Block: Size 8192 Version 4 Upper 8132 (0x1fc4)
LSN: logid ...... recoff 0x........ Special 8192 (0x2000)
Items: 2 Free Space: 8100
Checksum: 0x.... Prune XID: 0x00000000 Flags: 0x0004 (ALL_VISIBLE)
Length (including item array): 32
<Data> -----
Item 1 -- Length: 36 Offset: 8156 (0x1fdc) Flags: NORMAL
COPY: hello world
Item 2 -- Length: 24 Offset: 8132 (0x1fc4) Flags: NORMAL
COPY: \N
*** End of File Encountered. Last Block Read: 0 ***
--
----------------------------------------------------------------------------------------------
--
create table time (x time);
insert into time values ('00:00'), ('23:59:59'), ('23:59:60'), (null);
\set relname time
\ir run_test.sql
\echo Testing :relname
Testing time
vacuum :"relname";
checkpoint;
select relfilenode from pg_class where relname = :'relname' \gset
select lo_import(format('base/%s/%s', :'datoid', :'relfilenode')) as oid \gset
\set output :relname '.heap'
\lo_export :oid :output
\setenv relname :relname
\! pg_filedump -D $relname $relname.heap | ./sed.sh
*******************************************************************
* PostgreSQL File/Block Formatted Dump Utility
*
* File: time.heap
* Options used: -D time
*******************************************************************
Block 0 ********************************************************
<Header> -----
Block Offset: 0x00000000 Offsets: Lower 40 (0x0028)
Block: Size 8192 Version 4 Upper 8072 (0x1f88)
LSN: logid ...... recoff 0x........ Special 8192 (0x2000)
Items: 4 Free Space: 8032
Checksum: 0x.... Prune XID: 0x00000000 Flags: 0x0004 (ALL_VISIBLE)
Length (including item array): 40
<Data> -----
Item 1 -- Length: 32 Offset: 8160 (0x1fe0) Flags: NORMAL
COPY: 00:00:00.000000
Item 2 -- Length: 32 Offset: 8128 (0x1fc0) Flags: NORMAL
COPY: 23:59:59.000000
Item 3 -- Length: 32 Offset: 8096 (0x1fa0) Flags: NORMAL
COPY: 24:00:00.000000
Item 4 -- Length: 24 Offset: 8072 (0x1f88) Flags: NORMAL
COPY: \N
*** End of File Encountered. Last Block Read: 0 ***
--
----------------------------------------------------------------------------------------------
--
create table timestamp (x timestamp);
insert into timestamp values ('2000-01-01 00:00'), ('100-01-01 BC 2:22'), ('infinity'), ('-infinity'), (null);
\set relname timestamp
\ir run_test.sql
\echo Testing :relname
Testing timestamp
vacuum :"relname";
checkpoint;
select relfilenode from pg_class where relname = :'relname' \gset
select lo_import(format('base/%s/%s', :'datoid', :'relfilenode')) as oid \gset
\set output :relname '.heap'
\lo_export :oid :output
\setenv relname :relname
\! pg_filedump -D $relname $relname.heap | ./sed.sh
*******************************************************************
* PostgreSQL File/Block Formatted Dump Utility
*
* File: timestamp.heap
* Options used: -D timestamp
*******************************************************************
Block 0 ********************************************************
<Header> -----
Block Offset: 0x00000000 Offsets: Lower 44 (0x002c)
Block: Size 8192 Version 4 Upper 8040 (0x1f68)
LSN: logid ...... recoff 0x........ Special 8192 (0x2000)
Items: 5 Free Space: 7996
Checksum: 0x.... Prune XID: 0x00000000 Flags: 0x0004 (ALL_VISIBLE)
Length (including item array): 44
<Data> -----
Item 1 -- Length: 32 Offset: 8160 (0x1fe0) Flags: NORMAL
COPY: 2000-01-01 00:00:00.000000
Item 2 -- Length: 32 Offset: 8128 (0x1fc0) Flags: NORMAL
COPY: 0100-01-01 02:22:00.000000 BC
Item 3 -- Length: 32 Offset: 8096 (0x1fa0) Flags: NORMAL
COPY: infinity
Item 4 -- Length: 32 Offset: 8064 (0x1f80) Flags: NORMAL
COPY: -infinity
Item 5 -- Length: 24 Offset: 8040 (0x1f68) Flags: NORMAL
COPY: \N
*** End of File Encountered. Last Block Read: 0 ***
--
----------------------------------------------------------------------------------------------
--
set timezone = 'Etc/UTC';
create table timestamptz (x timestamptz);
insert into timestamptz values ('2000-01-01 00:00'), ('100-01-01 BC 2:22'), ('infinity'), ('-infinity'), (null);
\set relname timestamptz
\ir run_test.sql
\echo Testing :relname
Testing timestamptz
vacuum :"relname";
checkpoint;
select relfilenode from pg_class where relname = :'relname' \gset
select lo_import(format('base/%s/%s', :'datoid', :'relfilenode')) as oid \gset
\set output :relname '.heap'
\lo_export :oid :output
\setenv relname :relname
\! pg_filedump -D $relname $relname.heap | ./sed.sh
*******************************************************************
* PostgreSQL File/Block Formatted Dump Utility
*
* File: timestamptz.heap
* Options used: -D timestamptz
*******************************************************************
Block 0 ********************************************************
<Header> -----
Block Offset: 0x00000000 Offsets: Lower 44 (0x002c)
Block: Size 8192 Version 4 Upper 8040 (0x1f68)
LSN: logid ...... recoff 0x........ Special 8192 (0x2000)
Items: 5 Free Space: 7996
Checksum: 0x.... Prune XID: 0x00000000 Flags: 0x0004 (ALL_VISIBLE)
Length (including item array): 44
<Data> -----
Item 1 -- Length: 32 Offset: 8160 (0x1fe0) Flags: NORMAL
COPY: 2000-01-01 00:00:00.000000+00
Item 2 -- Length: 32 Offset: 8128 (0x1fc0) Flags: NORMAL
COPY: 0100-01-01 02:22:00.000000+00 BC
Item 3 -- Length: 32 Offset: 8096 (0x1fa0) Flags: NORMAL
COPY: infinity
Item 4 -- Length: 32 Offset: 8064 (0x1f80) Flags: NORMAL
COPY: -infinity
Item 5 -- Length: 24 Offset: 8040 (0x1f68) Flags: NORMAL
COPY: \N
*** End of File Encountered. Last Block Read: 0 ***
--
----------------------------------------------------------------------------------------------
--
create table timetz (x timetz);
insert into timetz values ('00:00 Etc/UTC'), ('23:59:59 Etc/UTC'), ('23:59:60 Etc/UTC'), ('1:23+4:56'), (null);
\set relname timetz
\ir run_test.sql
\echo Testing :relname
Testing timetz
vacuum :"relname";
checkpoint;
select relfilenode from pg_class where relname = :'relname' \gset
select lo_import(format('base/%s/%s', :'datoid', :'relfilenode')) as oid \gset
\set output :relname '.heap'
\lo_export :oid :output
\setenv relname :relname
\! pg_filedump -D $relname $relname.heap | ./sed.sh
*******************************************************************
* PostgreSQL File/Block Formatted Dump Utility
*
* File: timetz.heap
* Options used: -D timetz
*******************************************************************
Block 0 ********************************************************
<Header> -----
Block Offset: 0x00000000 Offsets: Lower 44 (0x002c)
Block: Size 8192 Version 4 Upper 8024 (0x1f58)
LSN: logid ...... recoff 0x........ Special 8192 (0x2000)
Items: 5 Free Space: 7980
Checksum: 0x.... Prune XID: 0x00000000 Flags: 0x0004 (ALL_VISIBLE)
Length (including item array): 44
<Data> -----
Item 1 -- Length: 36 Offset: 8156 (0x1fdc) Flags: NORMAL
COPY: 00:00:00.000000-00:00
Item 2 -- Length: 36 Offset: 8120 (0x1fb8) Flags: NORMAL
COPY: 23:59:59.000000-00:00
Item 3 -- Length: 36 Offset: 8084 (0x1f94) Flags: NORMAL
COPY: 24:00:00.000000-00:00
Item 4 -- Length: 36 Offset: 8048 (0x1f70) Flags: NORMAL
COPY: 01:23:00.000000+04:56
Item 5 -- Length: 24 Offset: 8024 (0x1f58) Flags: NORMAL
COPY: \N
*** End of File Encountered. Last Block Read: 0 ***
--
----------------------------------------------------------------------------------------------
--
create table uuid (x uuid);
insert into uuid values ('b4f0e2d6-429b-48bd-af06-6578829dd980'), ('00000000-0000-0000-0000-000000000000'), (null);
\set relname uuid
\ir run_test.sql
\echo Testing :relname
Testing uuid
vacuum :"relname";
checkpoint;
select relfilenode from pg_class where relname = :'relname' \gset
select lo_import(format('base/%s/%s', :'datoid', :'relfilenode')) as oid \gset
\set output :relname '.heap'
\lo_export :oid :output
\setenv relname :relname
\! pg_filedump -D $relname $relname.heap | ./sed.sh
*******************************************************************
* PostgreSQL File/Block Formatted Dump Utility
*
* File: uuid.heap
* Options used: -D uuid
*******************************************************************
Block 0 ********************************************************
<Header> -----
Block Offset: 0x00000000 Offsets: Lower 36 (0x0024)
Block: Size 8192 Version 4 Upper 8088 (0x1f98)
LSN: logid ...... recoff 0x........ Special 8192 (0x2000)
Items: 3 Free Space: 8052
Checksum: 0x.... Prune XID: 0x00000000 Flags: 0x0004 (ALL_VISIBLE)
Length (including item array): 36
<Data> -----
Item 1 -- Length: 40 Offset: 8152 (0x1fd8) Flags: NORMAL
COPY: b4f0e2d6-429b-48bd-af06-6578829dd980
Item 2 -- Length: 40 Offset: 8112 (0x1fb0) Flags: NORMAL
COPY: 00000000-0000-0000-0000-000000000000
Item 3 -- Length: 24 Offset: 8088 (0x1f98) Flags: NORMAL
COPY: \N
*** End of File Encountered. Last Block Read: 0 ***
--
----------------------------------------------------------------------------------------------
--
create table varchar (x varchar);
insert into varchar values ('Hello World'), (''), (null);
\set relname varchar
\ir run_test.sql
\echo Testing :relname
Testing varchar
vacuum :"relname";
checkpoint;
select relfilenode from pg_class where relname = :'relname' \gset
select lo_import(format('base/%s/%s', :'datoid', :'relfilenode')) as oid \gset
\set output :relname '.heap'
\lo_export :oid :output
\setenv relname :relname
\! pg_filedump -D $relname $relname.heap | ./sed.sh
*******************************************************************
* PostgreSQL File/Block Formatted Dump Utility
*
* File: varchar.heap
* Options used: -D varchar
*******************************************************************
Block 0 ********************************************************
<Header> -----
Block Offset: 0x00000000 Offsets: Lower 36 (0x0024)
Block: Size 8192 Version 4 Upper 8104 (0x1fa8)
LSN: logid ...... recoff 0x........ Special 8192 (0x2000)
Items: 3 Free Space: 8068
Checksum: 0x.... Prune XID: 0x00000000 Flags: 0x0004 (ALL_VISIBLE)
Length (including item array): 36
<Data> -----
Item 1 -- Length: 36 Offset: 8156 (0x1fdc) Flags: NORMAL
COPY: Hello World
Item 2 -- Length: 25 Offset: 8128 (0x1fc0) Flags: NORMAL
COPY:
Item 3 -- Length: 24 Offset: 8104 (0x1fa8) Flags: NORMAL
COPY: \N
*** End of File Encountered. Last Block Read: 0 ***
--
----------------------------------------------------------------------------------------------
--
create table "varcharN" (x varchar(11));
insert into "varcharN" values ('Hello World'), (''), (null);
\set relname varcharN
\ir run_test.sql
\echo Testing :relname
Testing varcharN
vacuum :"relname";
checkpoint;
select relfilenode from pg_class where relname = :'relname' \gset
select lo_import(format('base/%s/%s', :'datoid', :'relfilenode')) as oid \gset
\set output :relname '.heap'
\lo_export :oid :output
\setenv relname :relname
\! pg_filedump -D $relname $relname.heap | ./sed.sh
*******************************************************************
* PostgreSQL File/Block Formatted Dump Utility
*
* File: varcharN.heap
* Options used: -D varcharN
*******************************************************************
Block 0 ********************************************************
<Header> -----
Block Offset: 0x00000000 Offsets: Lower 36 (0x0024)
Block: Size 8192 Version 4 Upper 8104 (0x1fa8)
LSN: logid ...... recoff 0x........ Special 8192 (0x2000)
Items: 3 Free Space: 8068
Checksum: 0x.... Prune XID: 0x00000000 Flags: 0x0004 (ALL_VISIBLE)
Length (including item array): 36
<Data> -----
Item 1 -- Length: 36 Offset: 8156 (0x1fdc) Flags: NORMAL
COPY: Hello World
Item 2 -- Length: 25 Offset: 8128 (0x1fc0) Flags: NORMAL
COPY:
Item 3 -- Length: 24 Offset: 8104 (0x1fa8) Flags: NORMAL
COPY: \N
*** End of File Encountered. Last Block Read: 0 ***
--
----------------------------------------------------------------------------------------------
--
create table xid (x xid);
insert into xid values ('-1'), ('0'), ('1'), (null);
\set relname xid
\ir run_test.sql
\echo Testing :relname
Testing xid
vacuum :"relname";
checkpoint;
select relfilenode from pg_class where relname = :'relname' \gset
select lo_import(format('base/%s/%s', :'datoid', :'relfilenode')) as oid \gset
\set output :relname '.heap'
\lo_export :oid :output
\setenv relname :relname
\! pg_filedump -D $relname $relname.heap | ./sed.sh
*******************************************************************
* PostgreSQL File/Block Formatted Dump Utility
*
* File: xid.heap
* Options used: -D xid
*******************************************************************
Block 0 ********************************************************
<Header> -----
Block Offset: 0x00000000 Offsets: Lower 40 (0x0028)
Block: Size 8192 Version 4 Upper 8084 (0x1f94)
LSN: logid ...... recoff 0x........ Special 8192 (0x2000)
Items: 4 Free Space: 8044
Checksum: 0x.... Prune XID: 0x00000000 Flags: 0x0004 (ALL_VISIBLE)
Length (including item array): 40
<Data> -----
Item 1 -- Length: 28 Offset: 8164 (0x1fe4) Flags: NORMAL
COPY: 4294967295
Item 2 -- Length: 28 Offset: 8136 (0x1fc8) Flags: NORMAL
COPY: 0
Item 3 -- Length: 28 Offset: 8108 (0x1fac) Flags: NORMAL
COPY: 1
Item 4 -- Length: 24 Offset: 8084 (0x1f94) Flags: NORMAL
COPY: \N
*** End of File Encountered. Last Block Read: 0 ***
--
----------------------------------------------------------------------------------------------
--
|