| 553 | */ |
| 554 | |
| 555 | Oid |
| 556 | getTSCurrentConfig(bool emitError) |
| 557 | { |
| 558 | /* if we have a cached value, return it */ |
| 559 | if (OidIsValid(TSCurrentConfigCache)) |
| 560 | return TSCurrentConfigCache; |
| 561 | |
| 562 | /* fail if GUC hasn't been set up yet */ |
| 563 | if (TSCurrentConfig == NULL || *TSCurrentConfig == '\0') |
| 564 | { |
| 565 | if (emitError) |
| 566 | elog(ERROR, "text search configuration isn't set"); |
| 567 | else |
| 568 | return InvalidOid; |
| 569 | } |
| 570 | |
| 571 | if (TSConfigCacheHash == NULL) |
| 572 | { |
| 573 | /* First time through: initialize the tsconfig inval callback */ |
| 574 | init_ts_config_cache(); |
| 575 | } |
| 576 | |
| 577 | /* Look up the config */ |
| 578 | TSCurrentConfigCache = |
| 579 | get_ts_config_oid(stringToQualifiedNameList(TSCurrentConfig), |
| 580 | !emitError); |
| 581 | |
| 582 | return TSCurrentConfigCache; |
| 583 | } |
| 584 | |
| 585 | /* GUC check_hook for default_text_search_config */ |
| 586 | bool |
no test coverage detected