---------------- * boot_openrel * * Execute BKI OPEN command. * ---------------- */
| 629 | * ---------------- |
| 630 | */ |
| 631 | void |
| 632 | boot_openrel(char *relname) |
| 633 | { |
| 634 | int i; |
| 635 | |
| 636 | if (strlen(relname) >= NAMEDATALEN) |
| 637 | relname[NAMEDATALEN - 1] = '\0'; |
| 638 | |
| 639 | /* |
| 640 | * pg_type must be filled before any OPEN command is executed, hence we |
| 641 | * can now populate Typ if we haven't yet. |
| 642 | */ |
| 643 | if (Typ == NIL) |
| 644 | populate_typ_list(); |
| 645 | |
| 646 | if (boot_reldesc != NULL) |
| 647 | closerel(NULL); |
| 648 | |
| 649 | elog(DEBUG4, "open relation %s, attrsize %d", |
| 650 | relname, (int) ATTRIBUTE_FIXED_PART_SIZE); |
| 651 | |
| 652 | boot_reldesc = table_openrv(makeRangeVar(NULL, relname, -1), NoLock); |
| 653 | numattr = RelationGetNumberOfAttributes(boot_reldesc); |
| 654 | for (i = 0; i < numattr; i++) |
| 655 | { |
| 656 | if (attrtypes[i] == NULL) |
| 657 | attrtypes[i] = AllocateAttribute(); |
| 658 | memmove((char *) attrtypes[i], |
| 659 | (char *) TupleDescAttr(boot_reldesc->rd_att, i), |
| 660 | ATTRIBUTE_FIXED_PART_SIZE); |
| 661 | |
| 662 | { |
| 663 | Form_pg_attribute at = attrtypes[i]; |
| 664 | |
| 665 | elog(DEBUG4, "create attribute %d name %s len %d num %d type %u", |
| 666 | i, NameStr(at->attname), at->attlen, at->attnum, |
| 667 | at->atttypid); |
| 668 | } |
| 669 | } |
| 670 | } |
| 671 | |
| 672 | /* ---------------- |
| 673 | * closerel |
nothing calls this directly
no test coverage detected