|
80 | 80 | # define table_close(rel, lock) heap_close((rel), (lock)) |
81 | 81 | #endif |
82 | 82 |
|
83 | | -#ifndef PG_GETARG_JSONB_P |
| 83 | +#if PG_VERSION_NUM < 110000 |
84 | 84 | #define PG_GETARG_JSONB_P(x) DatumGetJsonb(PG_GETARG_DATUM(x)) |
85 | 85 | #endif |
86 | 86 |
|
@@ -597,16 +597,15 @@ static Oid |
597 | 597 | get_extension_schema(Oid ext_oid) |
598 | 598 | { |
599 | 599 | Oid result; |
600 | | - Relation rel; |
601 | 600 | SysScanDesc scandesc; |
602 | 601 | HeapTuple tuple; |
603 | 602 | ScanKeyData entry[1]; |
604 | | - rel = table_open(ExtensionRelationId, AccessShareLock); |
605 | 603 | #if PG_VERSION_NUM >= 120000 |
606 | 604 | Oid pg_extension_oid = Anum_pg_extension_oid; |
607 | 605 | #else |
608 | 606 | Oid pg_extension_oid = ObjectIdAttributeNumber; |
609 | 607 | #endif |
| 608 | + Relation rel = table_open(ExtensionRelationId, AccessShareLock); |
610 | 609 |
|
611 | 610 | ScanKeyInit(&entry[0], |
612 | 611 | pg_extension_oid, |
@@ -642,18 +641,19 @@ typname_get_tupledesc(const char *extname, const char *typname) |
642 | 641 | { |
643 | 642 | Oid extoid = get_extension_oid(extname, true); |
644 | 643 | Oid extschemaoid; |
| 644 | + Oid typoid; |
645 | 645 |
|
646 | 646 | if ( ! OidIsValid(extoid) ) |
647 | 647 | elog(ERROR, "could not lookup '%s' extension oid", extname); |
648 | 648 |
|
649 | 649 | extschemaoid = get_extension_schema(extoid); |
650 | 650 |
|
651 | 651 | #if PG_VERSION_NUM >= 120000 |
652 | | - Oid typoid = GetSysCacheOid2(TYPENAMENSP, Anum_pg_type_oid, |
| 652 | + typoid = GetSysCacheOid2(TYPENAMENSP, Anum_pg_type_oid, |
653 | 653 | PointerGetDatum(typname), |
654 | 654 | ObjectIdGetDatum(extschemaoid)); |
655 | 655 | #else |
656 | | - Oid typoid = GetSysCacheOid2(TYPENAMENSP, |
| 656 | + typoid = GetSysCacheOid2(TYPENAMENSP, |
657 | 657 | PointerGetDatum(typname), |
658 | 658 | ObjectIdGetDatum(extschemaoid)); |
659 | 659 | #endif |
|
0 commit comments