agora inbox for [email protected]help / color / mirror / Atom feed
[PATCH v4 4/7] Row pattern recognition patch (executor). 34+ messages / 2 participants [nested] [flat]
* [PATCH v4 4/7] Row pattern recognition patch (executor). @ 2023-08-09 07:56 Tatsuo Ishii <[email protected]> 0 siblings, 0 replies; 34+ messages in thread From: Tatsuo Ishii @ 2023-08-09 07:56 UTC (permalink / raw) --- src/backend/executor/nodeWindowAgg.c | 674 ++++++++++++++++++++++++++- src/backend/utils/adt/windowfuncs.c | 38 +- src/include/catalog/pg_proc.dat | 6 + src/include/nodes/execnodes.h | 19 + src/include/windowapi.h | 8 + 5 files changed, 732 insertions(+), 13 deletions(-) diff --git a/src/backend/executor/nodeWindowAgg.c b/src/backend/executor/nodeWindowAgg.c index 310ac23e3a..5354e47045 100644 --- a/src/backend/executor/nodeWindowAgg.c +++ b/src/backend/executor/nodeWindowAgg.c @@ -36,6 +36,7 @@ #include "access/htup_details.h" #include "catalog/objectaccess.h" #include "catalog/pg_aggregate.h" +#include "catalog/pg_collation_d.h" #include "catalog/pg_proc.h" #include "executor/executor.h" #include "executor/nodeWindowAgg.h" @@ -48,6 +49,7 @@ #include "utils/acl.h" #include "utils/builtins.h" #include "utils/datum.h" +#include "utils/fmgroids.h" #include "utils/expandeddatum.h" #include "utils/lsyscache.h" #include "utils/memutils.h" @@ -182,8 +184,9 @@ static void begin_partition(WindowAggState *winstate); static void spool_tuples(WindowAggState *winstate, int64 pos); static void release_partition(WindowAggState *winstate); -static int row_is_in_frame(WindowAggState *winstate, int64 pos, +static int row_is_in_frame(WindowAggState *winstate, int64 pos, TupleTableSlot *slot); + static void update_frameheadpos(WindowAggState *winstate); static void update_frametailpos(WindowAggState *winstate); static void update_grouptailpos(WindowAggState *winstate); @@ -195,9 +198,20 @@ static Datum GetAggInitVal(Datum textInitVal, Oid transtype); static bool are_peers(WindowAggState *winstate, TupleTableSlot *slot1, TupleTableSlot *slot2); -static bool window_gettupleslot(WindowObject winobj, int64 pos, - TupleTableSlot *slot); +static void attno_map(Node *node); +static bool attno_map_walker(Node *node, void *context); +static int row_is_in_reduced_frame(WindowObject winobj, int64 pos); + +static int64 evaluate_pattern(WindowObject winobj, int64 current_pos, + char *vname, StringInfo encoded_str, bool *result); + +static bool get_slots(WindowObject winobj, int64 current_pos); + +static int search_str_set(char *pattern, StringInfo *str_set, int set_size); +static void search_str_set_recurse(char *pattern, StringInfo *str_set, int set_size, int set_index, + char *encoded_str, int *resultlen); +static char pattern_initial(WindowAggState *winstate, char *vname); /* * initialize_windowaggregate @@ -673,6 +687,9 @@ eval_windowaggregates(WindowAggState *winstate) WindowObject agg_winobj; TupleTableSlot *agg_row_slot; TupleTableSlot *temp_slot; + bool reduced_frame_set; + bool check_reduced_frame; + int num_rows_in_reduced_frame; numaggs = winstate->numaggs; if (numaggs == 0) @@ -790,6 +807,7 @@ eval_windowaggregates(WindowAggState *winstate) (winstate->frameOptions & FRAMEOPTION_EXCLUSION) || winstate->aggregatedupto <= winstate->frameheadpos) { + elog(DEBUG1, "peraggstate->restart is set"); peraggstate->restart = true; numaggs_restart++; } @@ -861,8 +879,10 @@ eval_windowaggregates(WindowAggState *winstate) * If we created a mark pointer for aggregates, keep it pushed up to frame * head, so that tuplestore can discard unnecessary rows. */ +#ifdef NOT_USED if (agg_winobj->markptr >= 0) WinSetMarkPosition(agg_winobj, winstate->frameheadpos); +#endif /* * Now restart the aggregates that require it. @@ -919,6 +939,10 @@ eval_windowaggregates(WindowAggState *winstate) ExecClearTuple(agg_row_slot); } + reduced_frame_set = false; + check_reduced_frame = false; + num_rows_in_reduced_frame = 0; + /* * Advance until we reach a row not in frame (or end of partition). * @@ -930,12 +954,18 @@ eval_windowaggregates(WindowAggState *winstate) { int ret; + elog(DEBUG1, "===== loop in frame starts: " INT64_FORMAT, winstate->aggregatedupto); + /* Fetch next row if we didn't already */ if (TupIsNull(agg_row_slot)) { if (!window_gettupleslot(agg_winobj, winstate->aggregatedupto, agg_row_slot)) + { + if (check_reduced_frame) + winstate->aggregatedupto--; break; /* must be end of partition */ + } } /* @@ -944,10 +974,47 @@ eval_windowaggregates(WindowAggState *winstate) */ ret = row_is_in_frame(winstate, winstate->aggregatedupto, agg_row_slot); if (ret < 0) + { + if (winstate->patternVariableList != NIL && check_reduced_frame) + winstate->aggregatedupto--; break; + } if (ret == 0) goto next_tuple; + if (winstate->patternVariableList != NIL) + { + if (!reduced_frame_set) + { + num_rows_in_reduced_frame = row_is_in_reduced_frame(winstate->agg_winobj, winstate->aggregatedupto); + reduced_frame_set = true; + elog(DEBUG1, "set num_rows_in_reduced_frame: %d pos: " INT64_FORMAT, + num_rows_in_reduced_frame, winstate->aggregatedupto); + + if (num_rows_in_reduced_frame <= 0) + break; + + else if (num_rows_in_reduced_frame > 0) + check_reduced_frame = true; + } + + if (check_reduced_frame) + { + elog(DEBUG1, "decrease num_rows_in_reduced_frame: %d pos: " INT64_FORMAT, + num_rows_in_reduced_frame, winstate->aggregatedupto); + num_rows_in_reduced_frame--; + if (num_rows_in_reduced_frame < 0) + { + /* + * No more rows remain in the reduced frame. Finish + * accumulating row into the aggregates. + */ + winstate->aggregatedupto--; + break; + } + } + } + /* Set tuple context for evaluation of aggregate arguments */ winstate->tmpcontext->ecxt_outertuple = agg_row_slot; @@ -976,6 +1043,8 @@ next_tuple: ExecClearTuple(agg_row_slot); } + elog(DEBUG1, "===== break loop in frame starts: " INT64_FORMAT, winstate->aggregatedupto); + /* The frame's end is not supposed to move backwards, ever */ Assert(aggregatedupto_nonrestarted <= winstate->aggregatedupto); @@ -2053,6 +2122,8 @@ ExecWindowAgg(PlanState *pstate) CHECK_FOR_INTERRUPTS(); + elog(DEBUG1, "ExecWindowAgg called. pos: " INT64_FORMAT , winstate->currentpos); + if (winstate->status == WINDOWAGG_DONE) return NULL; @@ -2388,6 +2459,9 @@ ExecInitWindowAgg(WindowAgg *node, EState *estate, int eflags) TupleDesc scanDesc; ListCell *l; + TargetEntry *te; + Expr *expr; + /* check for unsupported flags */ Assert(!(eflags & (EXEC_FLAG_BACKWARD | EXEC_FLAG_MARK))); @@ -2483,6 +2557,16 @@ ExecInitWindowAgg(WindowAgg *node, EState *estate, int eflags) winstate->temp_slot_2 = ExecInitExtraTupleSlot(estate, scanDesc, &TTSOpsMinimalTuple); + winstate->prev_slot = ExecInitExtraTupleSlot(estate, scanDesc, + &TTSOpsMinimalTuple); + + winstate->next_slot = ExecInitExtraTupleSlot(estate, scanDesc, + &TTSOpsMinimalTuple); + + winstate->null_slot = ExecInitExtraTupleSlot(estate, scanDesc, + &TTSOpsMinimalTuple); + winstate->null_slot = ExecStoreAllNullTuple(winstate->null_slot); + /* * create frame head and tail slots only if needed (must create slots in * exactly the same cases that update_frameheadpos and update_frametailpos @@ -2667,6 +2751,39 @@ ExecInitWindowAgg(WindowAgg *node, EState *estate, int eflags) winstate->inRangeAsc = node->inRangeAsc; winstate->inRangeNullsFirst = node->inRangeNullsFirst; + /* Set up SKIP TO type */ + winstate->rpSkipTo = node->rpSkipTo; + /* Set up row pattern recognition PATTERN clause */ + winstate->patternVariableList = node->patternVariable; + winstate->patternRegexpList = node->patternRegexp; + + /* Set up row pattern recognition DEFINE clause */ + winstate->defineInitial = node->defineInitial; + winstate->defineVariableList = NIL; + winstate->defineClauseList = NIL; + if (node->defineClause != NIL) + { + /* + * Tweak arg var of PREV/NEXT so that it refers to scan/inner slot. + */ + foreach(l, node->defineClause) + { + char *name; + ExprState *exps; + + te = lfirst(l); + name = te->resname; + expr = te->expr; + + elog(DEBUG1, "defineVariable name: %s", name); + winstate->defineVariableList = lappend(winstate->defineVariableList, + makeString(pstrdup(name))); + attno_map((Node *)expr); + exps = ExecInitExpr(expr, (PlanState *) winstate); + winstate->defineClauseList = lappend(winstate->defineClauseList, exps); + } + } + winstate->all_first = true; winstate->partition_spooled = false; winstate->more_partitions = false; @@ -2674,6 +2791,57 @@ ExecInitWindowAgg(WindowAgg *node, EState *estate, int eflags) return winstate; } +/* + * Rewrite varno of Var node that is the argument of PREV/NET so that it sees + * scan tuple (PREV) or inner tuple (NEXT). + */ +static void +attno_map(Node *node) +{ + (void) expression_tree_walker(node, attno_map_walker, NULL); +} + +static bool +attno_map_walker(Node *node, void *context) +{ + FuncExpr *func; + int nargs; + Expr *expr; + Var *var; + + if (node == NULL) + return false; + + if (IsA(node, FuncExpr)) + { + func = (FuncExpr *)node; + + if (func->funcid == F_PREV || func->funcid == F_NEXT) + { + /* sanity check */ + nargs = list_length(func->args); + if (list_length(func->args) != 1) + elog(ERROR, "PREV/NEXT must have 1 argument but function %d has %d args", func->funcid, nargs); + + expr = (Expr *) lfirst(list_head(func->args)); + if (!IsA(expr, Var)) + elog(ERROR, "PREV/NEXT's arg is not Var"); /* XXX: is it possible that arg type is Const? */ + var = (Var *)expr; + + if (func->funcid == F_PREV) + /* + * Rewrite varno from OUTER_VAR to regular var no so that the + * var references scan tuple. + */ + var->varno = var->varnosyn; + else + var->varno = INNER_VAR; + elog(DEBUG1, "PREV/NEXT's varno is rewritten to: %d", var->varno); + } + } + return expression_tree_walker(node, attno_map_walker, NULL); +} + /* ----------------- * ExecEndWindowAgg * ----------------- @@ -2691,6 +2859,8 @@ ExecEndWindowAgg(WindowAggState *node) ExecClearTuple(node->agg_row_slot); ExecClearTuple(node->temp_slot_1); ExecClearTuple(node->temp_slot_2); + ExecClearTuple(node->prev_slot); + ExecClearTuple(node->next_slot); if (node->framehead_slot) ExecClearTuple(node->framehead_slot); if (node->frametail_slot) @@ -2740,6 +2910,8 @@ ExecReScanWindowAgg(WindowAggState *node) ExecClearTuple(node->agg_row_slot); ExecClearTuple(node->temp_slot_1); ExecClearTuple(node->temp_slot_2); + ExecClearTuple(node->prev_slot); + ExecClearTuple(node->next_slot); if (node->framehead_slot) ExecClearTuple(node->framehead_slot); if (node->frametail_slot) @@ -3080,7 +3252,7 @@ are_peers(WindowAggState *winstate, TupleTableSlot *slot1, * * Returns true if successful, false if no such row */ -static bool +bool window_gettupleslot(WindowObject winobj, int64 pos, TupleTableSlot *slot) { WindowAggState *winstate = winobj->winstate; @@ -3100,7 +3272,7 @@ window_gettupleslot(WindowObject winobj, int64 pos, TupleTableSlot *slot) return false; if (pos < winobj->markpos) - elog(ERROR, "cannot fetch row before WindowObject's mark position"); + elog(ERROR, "cannot fetch row: " INT64_FORMAT " before WindowObject's mark position: " INT64_FORMAT, pos, winobj->markpos ); oldcontext = MemoryContextSwitchTo(winstate->ss.ps.ps_ExprContext->ecxt_per_query_memory); @@ -3420,14 +3592,54 @@ WinGetFuncArgInFrame(WindowObject winobj, int argno, WindowAggState *winstate; ExprContext *econtext; TupleTableSlot *slot; - int64 abs_pos; - int64 mark_pos; Assert(WindowObjectIsValid(winobj)); winstate = winobj->winstate; econtext = winstate->ss.ps.ps_ExprContext; slot = winstate->temp_slot_1; + if (WinGetSlotInFrame(winobj, slot, + relpos, seektype, set_mark, + isnull, isout) == 0) + { + econtext->ecxt_outertuple = slot; + return ExecEvalExpr((ExprState *) list_nth(winobj->argstates, argno), + econtext, isnull); + } + + if (isout) + *isout = true; + *isnull = true; + return (Datum) 0; +} + +/* + * WinGetSlotInFrame + * slot: TupleTableSlot to store the result + * relpos: signed rowcount offset from the seek position + * seektype: WINDOW_SEEK_HEAD or WINDOW_SEEK_TAIL + * set_mark: If the row is found/in frame and set_mark is true, the mark is + * moved to the row as a side-effect. + * isnull: output argument, receives isnull status of result + * isout: output argument, set to indicate whether target row position + * is out of frame (can pass NULL if caller doesn't care about this) + * + * Returns 0 if we successfullt got the slot. false if out of frame. + * (also isout is set) + */ +int +WinGetSlotInFrame(WindowObject winobj, TupleTableSlot *slot, + int relpos, int seektype, bool set_mark, + bool *isnull, bool *isout) +{ + WindowAggState *winstate; + int64 abs_pos; + int64 mark_pos; + int num_reduced_frame; + + Assert(WindowObjectIsValid(winobj)); + winstate = winobj->winstate; + switch (seektype) { case WINDOW_SEEK_CURRENT: @@ -3494,6 +3706,12 @@ WinGetFuncArgInFrame(WindowObject winobj, int argno, winstate->frameOptions); break; } + num_reduced_frame = row_is_in_reduced_frame(winobj, winstate->frameheadpos); + if (num_reduced_frame < 0) + goto out_of_frame; + else if (num_reduced_frame > 0) + if (relpos >= num_reduced_frame) + goto out_of_frame; break; case WINDOW_SEEK_TAIL: /* rejecting relpos > 0 is easy and simplifies code below */ @@ -3565,6 +3783,12 @@ WinGetFuncArgInFrame(WindowObject winobj, int argno, mark_pos = 0; /* keep compiler quiet */ break; } + + num_reduced_frame = row_is_in_reduced_frame(winobj, winstate->frameheadpos + relpos); + if (num_reduced_frame < 0) + goto out_of_frame; + else if (num_reduced_frame > 0) + abs_pos = winstate->frameheadpos + relpos + num_reduced_frame - 1; break; default: elog(ERROR, "unrecognized window seek type: %d", seektype); @@ -3583,15 +3807,13 @@ WinGetFuncArgInFrame(WindowObject winobj, int argno, *isout = false; if (set_mark) WinSetMarkPosition(winobj, mark_pos); - econtext->ecxt_outertuple = slot; - return ExecEvalExpr((ExprState *) list_nth(winobj->argstates, argno), - econtext, isnull); + return 0; out_of_frame: if (isout) *isout = true; *isnull = true; - return (Datum) 0; + return -1; } /* @@ -3622,3 +3844,433 @@ WinGetFuncArgCurrent(WindowObject winobj, int argno, bool *isnull) return ExecEvalExpr((ExprState *) list_nth(winobj->argstates, argno), econtext, isnull); } + +WindowAggState * +WinGetAggState(WindowObject winobj) +{ + return winobj->winstate; +} + +/* + * row_is_in_reduced_frame + * Determine whether a row is in the current row's reduced window frame according + * to row pattern matching + * + * The row must has been already determined that it is in a full window frame + * and fetched it into slot. + * + * Returns: + * = 0, RPR is not defined. + * >0, if the row is the first in the reduced frame. Return the number of rows in the reduced frame. + * -1, if the row is unmatched row + * -2, if the row is in the reduced frame but needed to be skipped because of + * AFTER MATCH SKIP PAST LAST ROW + */ +static +int row_is_in_reduced_frame(WindowObject winobj, int64 pos) +{ + WindowAggState *winstate = winobj->winstate; + ListCell *lc1, *lc2; + bool expression_result; + int num_matched_rows; + int64 original_pos; + bool anymatch; + StringInfo encoded_str; + StringInfo pattern_str = makeStringInfo(); + + /* + * Array of pattern variables evaluted to true. + * Each character corresponds to pattern variable. + * Example: + * str_set[0] = "AB"; + * str_set[1] = "AC"; + * In this case at row 0 A and B are true, and A and C are true in row 1. + */ + #define ENCODED_STR_ARRAY_ALLOC_SIZE 128 + StringInfo *str_set = NULL; + int str_set_index; + int str_set_size; + + if (winstate->patternVariableList == NIL) + { + /* + * RPR is not defined. Assume that we are always in the the reduced + * window frame. + */ + return 0; + } + + /* save original pos */ + original_pos = pos; + + /* + * Check whether the row speicied by pos is in the reduced frame. The + * second and subsequent rows need to be recognized as "unmatched" rows if + * AFTER MATCH SKIP PAST LAST ROW is defined. + */ + if (winstate->rpSkipTo == ST_PAST_LAST_ROW && + pos > winstate->headpos_in_reduced_frame && + pos < (winstate->headpos_in_reduced_frame + winstate->num_rows_in_reduced_frame)) + return -2; + + /* + * Loop over until none of pattern matches or encounters end of frame. + */ + for (;;) + { + int64 result_pos = -1; + + /* + * Loop over each PATTERN variable. + */ + anymatch = false; + encoded_str = makeStringInfo(); + + forboth(lc1, winstate->patternVariableList, lc2, winstate->patternRegexpList) + { + char *vname = strVal(lfirst(lc1)); + char *quantifier = strVal(lfirst(lc2)); + + elog(DEBUG1, "pos: " INT64_FORMAT " pattern vname: %s quantifier: %s", pos, vname, quantifier); + + expression_result = false; + + /* evaluate row pattern against current row */ + result_pos = evaluate_pattern(winobj, pos, vname, encoded_str, &expression_result); + if (expression_result) + { + elog(DEBUG1, "expression result is true"); + anymatch = true; + } + + /* + * If out of frame, we are done. + */ + if (result_pos < 0) + break; + } + + if (!anymatch) + { + /* none of patterns matched. */ + break; + } + + /* build encoded string array */ + if (str_set == NULL) + { + str_set_index = 0; + str_set_size = ENCODED_STR_ARRAY_ALLOC_SIZE * sizeof(StringInfo); + str_set = palloc(str_set_size); + } + + str_set[str_set_index++] = encoded_str; + + elog(DEBUG1, "pos: " INT64_FORMAT " str_set_index: %d encoded_str: %s", pos, str_set_index, encoded_str->data); + + if (str_set_index >= str_set_size) + { + str_set_size *= 2; + str_set = repalloc(str_set, str_set_size); + } + + /* move to next row */ + pos++; + + if (result_pos < 0) + { + /* out of frame */ + break; + } + } + + if (str_set == NULL) + { + /* no matches found in the first row */ + return -1; + } + + elog(DEBUG1, "pos: " INT64_FORMAT " encoded_str: %s", pos, encoded_str->data); + + /* build regular expression */ + pattern_str = makeStringInfo(); + appendStringInfoChar(pattern_str, '^'); + forboth (lc1, winstate->patternVariableList, lc2, winstate->patternRegexpList) + { + char *vname = strVal(lfirst(lc1)); + char *quantifier = strVal(lfirst(lc2)); + char initial; + + initial = pattern_initial(winstate, vname); + Assert(initial != 0); + appendStringInfoChar(pattern_str, initial); + if (quantifier[0]) + appendStringInfoChar(pattern_str, quantifier[0]); + elog(DEBUG1, "vname: %s initial: %c quantifier: %s", vname, initial, quantifier); + } + + elog(DEBUG1, "pos: " INT64_FORMAT " pattern: %s", pos, pattern_str->data); + + /* look for matching pattern variable sequence */ + num_matched_rows = search_str_set(pattern_str->data, str_set, str_set_index); + if (num_matched_rows <= 0) + return -1; + + /* + * We are at the first row in the reduced frame. Save the number of + * matched rows as the number of rows in the reduced frame. + */ + winstate->headpos_in_reduced_frame = original_pos; + winstate->num_rows_in_reduced_frame = num_matched_rows; + + return num_matched_rows; +} + +/* + * search set of encode_str. + * set_size: size of set_str array. + */ +static +int search_str_set(char *pattern, StringInfo *str_set, int set_size) +{ + char *encoded_str = palloc0(set_size+1); + int resultlen = 0; + + search_str_set_recurse(pattern, str_set, set_size, 0, encoded_str, &resultlen); + elog(DEBUG1, "search_str_set returns %d", resultlen); + return resultlen; +} + +static +void search_str_set_recurse(char *pattern, StringInfo *str_set, + int set_size, int set_index, char *encoded_str, int *resultlen) +{ + char *p; + + if (set_index >= set_size) + { + Datum d; + text *res; + char *substr; + + /* + * We first perform pattern matching using regexp_instr, then call + * textregexsubstr to get matched substring to know how log the + * matched string is. That is the number of rows in the reduced window + * frame. The reason why we can't call textregexsubstr is, it error + * out if pattern is not match. + */ + if (DatumGetInt32(DirectFunctionCall2Coll(regexp_instr, DEFAULT_COLLATION_OID, + PointerGetDatum(cstring_to_text(encoded_str)), + PointerGetDatum(cstring_to_text(pattern)))) > 0) + { + d = DirectFunctionCall2Coll(textregexsubstr, + DEFAULT_COLLATION_OID, + PointerGetDatum(cstring_to_text(encoded_str)), + PointerGetDatum(cstring_to_text(pattern))); + if (d != 0) + { + int len; + + res = DatumGetTextPP(d); + substr = text_to_cstring(res); + len = strlen(substr); + if (len > *resultlen) + /* remember the longest match */ + *resultlen = len; + } + } + return; + } + + p = str_set[set_index]->data; + while (*p) + { + encoded_str[set_index] = *p; + p++; + search_str_set_recurse(pattern, str_set, set_size, set_index + 1, encoded_str, resultlen); + } +} + + +/* + * Evaluate expression associated with PATTERN variable vname. + * relpos is relative row position in a frame (starting from 0). + * "quantifier" is the quatifier part of the PATTERN regular expression. + * Currently only '+' is allowed. + * result is out paramater representing the expression evaluation result + * is true of false. + * Return values are: + * >=0: the last match absolute row position + * other wise out of frame. + */ +static +int64 evaluate_pattern(WindowObject winobj, int64 current_pos, + char *vname, StringInfo encoded_str, bool *result) +{ + WindowAggState *winstate = winobj->winstate; + ExprContext *econtext = winstate->ss.ps.ps_ExprContext; + ListCell *lc1, *lc2, *lc3; + ExprState *pat; + Datum eval_result; + bool out_of_frame = false; + bool isnull; + + forthree (lc1, winstate->defineVariableList, lc2, winstate->defineClauseList, lc3, winstate->defineInitial) + { + char initial; + char *name = strVal(lfirst(lc1)); + + elog(DEBUG1, "evaluate_pattern: define variable: %s, pattern variable: %s", name, vname); + + if (strcmp(vname, name)) + continue; + + initial = *(strVal(lfirst(lc3))); + + /* set expression to evaluate */ + pat = lfirst(lc2); + + /* get current, previous and next tuples */ + if (!get_slots(winobj, current_pos)) + { + out_of_frame = true; + } + else + { + /* evaluate the expression */ + eval_result = ExecEvalExpr(pat, econtext, &isnull); + if (isnull) + { + /* expression is NULL */ + elog(DEBUG1, "expression for %s is NULL at row: " INT64_FORMAT, vname, current_pos); + *result = false; + } + else + { + if (!DatumGetBool(eval_result)) + { + /* expression is false */ + elog(DEBUG1, "expression for %s is false at row: " INT64_FORMAT, vname, current_pos); + *result = false; + } + else + { + /* expression is true */ + elog(DEBUG1, "expression for %s is true at row: " INT64_FORMAT, vname, current_pos); + appendStringInfoChar(encoded_str, initial); + *result = true; + } + } + break; + } + + if (out_of_frame) + { + *result = false; + return -1; + } + } + return current_pos; +} + +/* + * Get current, previous and next tuples. + * Returns false if current row is out of partition/full frame. + */ +static +bool get_slots(WindowObject winobj, int64 current_pos) +{ + WindowAggState *winstate = winobj->winstate; + TupleTableSlot *slot; + int ret; + ExprContext *econtext; + + econtext = winstate->ss.ps.ps_ExprContext; + + /* set up current row tuple slot */ + slot = winstate->temp_slot_1; + if (!window_gettupleslot(winobj, current_pos, slot)) + { + elog(DEBUG1, "current row is out of partition at:" INT64_FORMAT, current_pos); + return false; + + ret = row_is_in_frame(winstate, current_pos, slot); + if (ret <= 0) + { + elog(DEBUG1, "current row is out of frame at: " INT64_FORMAT, current_pos); + return false; + } + } + econtext->ecxt_outertuple = slot; + + /* for PREV */ + if (current_pos > 0) + { + slot = winstate->prev_slot; + if (!window_gettupleslot(winobj, current_pos - 1, slot)) + { + elog(DEBUG1, "previous row is out of partition at: " INT64_FORMAT, current_pos - 1); + econtext->ecxt_scantuple = winstate->null_slot; + } + else + { + ret = row_is_in_frame(winstate, current_pos - 1, slot); + if (ret <= 0) + { + elog(DEBUG1, "previous row is out of frame at: " INT64_FORMAT, current_pos - 1); + econtext->ecxt_scantuple = winstate->null_slot; + } + else + { + econtext->ecxt_scantuple = slot; + } + } + } + else + econtext->ecxt_scantuple = winstate->null_slot; + + /* for NEXT */ + slot = winstate->next_slot; + if (!window_gettupleslot(winobj, current_pos + 1, slot)) + { + elog(DEBUG1, "next row is out of partiton at: " INT64_FORMAT, current_pos + 1); + econtext->ecxt_innertuple = winstate->null_slot; + } + else + { + ret = row_is_in_frame(winstate, current_pos + 1, slot); + if (ret <= 0) + { + elog(DEBUG1, "next row is out of frame at: " INT64_FORMAT, current_pos + 1); + econtext->ecxt_innertuple = winstate->null_slot; + } + else + econtext->ecxt_innertuple = slot; + } + return true; +} + +/* + * Return pattern variable initial character + * matching with pattern variable name vname. + * If not found, return 0. + */ +static +char pattern_initial(WindowAggState *winstate, char *vname) +{ + char initial; + char *name; + ListCell *lc1, *lc2; + + forboth (lc1, winstate->defineVariableList, lc2, winstate->defineInitial) + { + name = strVal(lfirst(lc1)); /* DEFINE variable name */ + initial = *(strVal(lfirst(lc2))); /* DEFINE variable initial */ + + + if (!strcmp(name, vname)) + return initial; /* found */ + } + return 0; +} diff --git a/src/backend/utils/adt/windowfuncs.c b/src/backend/utils/adt/windowfuncs.c index b87a624fb2..e4cab36ec9 100644 --- a/src/backend/utils/adt/windowfuncs.c +++ b/src/backend/utils/adt/windowfuncs.c @@ -13,6 +13,9 @@ */ #include "postgres.h" +#include "catalog/pg_collation_d.h" +#include "executor/executor.h" +#include "nodes/execnodes.h" #include "nodes/supportnodes.h" #include "utils/builtins.h" #include "windowapi.h" @@ -36,11 +39,19 @@ typedef struct int64 remainder; /* (total rows) % (bucket num) */ } ntile_context; +/* + * rpr process information. + * Used for AFTER MATCH SKIP PAST LAST ROW + */ +typedef struct SkipContext +{ + int64 pos; /* last row absolute position */ +} SkipContext; + static bool rank_up(WindowObject winobj); static Datum leadlag_common(FunctionCallInfo fcinfo, bool forward, bool withoffset, bool withdefault); - /* * utility routine for *_rank functions. */ @@ -673,7 +684,7 @@ window_last_value(PG_FUNCTION_ARGS) bool isnull; result = WinGetFuncArgInFrame(winobj, 0, - 0, WINDOW_SEEK_TAIL, true, + 0, WINDOW_SEEK_TAIL, false, &isnull, NULL); if (isnull) PG_RETURN_NULL(); @@ -713,3 +724,26 @@ window_nth_value(PG_FUNCTION_ARGS) PG_RETURN_DATUM(result); } + +/* + * prev + * Dummy function to invoke RPR's navigation operator "PREV". + * This is *not* a window function. + */ +Datum +window_prev(PG_FUNCTION_ARGS) +{ + PG_RETURN_DATUM(PG_GETARG_DATUM(0)); +} + +/* + * next + * Dummy function to invoke RPR's navigation operation "NEXT". + * This is *not* a window function. + */ +Datum +window_next(PG_FUNCTION_ARGS) +{ + PG_RETURN_DATUM(PG_GETARG_DATUM(0)); +} + diff --git a/src/include/catalog/pg_proc.dat b/src/include/catalog/pg_proc.dat index 6996073989..fa100b2665 100644 --- a/src/include/catalog/pg_proc.dat +++ b/src/include/catalog/pg_proc.dat @@ -10397,6 +10397,12 @@ { oid => '3114', descr => 'fetch the Nth row value', proname => 'nth_value', prokind => 'w', prorettype => 'anyelement', proargtypes => 'anyelement int4', prosrc => 'window_nth_value' }, +{ oid => '6122', descr => 'previous value', + proname => 'prev', provolatile => 's', prorettype => 'anyelement', + proargtypes => 'anyelement', prosrc => 'window_prev' }, +{ oid => '6123', descr => 'next value', + proname => 'next', provolatile => 's', prorettype => 'anyelement', + proargtypes => 'anyelement', prosrc => 'window_next' }, # functions for range types { oid => '3832', descr => 'I/O', diff --git a/src/include/nodes/execnodes.h b/src/include/nodes/execnodes.h index cb714f4a19..2bd6fcb5e1 100644 --- a/src/include/nodes/execnodes.h +++ b/src/include/nodes/execnodes.h @@ -2519,6 +2519,15 @@ typedef struct WindowAggState int64 groupheadpos; /* current row's peer group head position */ int64 grouptailpos; /* " " " " tail position (group end+1) */ + /* these fields are used in Row pattern recognition: */ + RPSkipTo rpSkipTo; /* Row Pattern Skip To type */ + List *patternVariableList; /* list of row pattern variables names (list of String) */ + List *patternRegexpList; /* list of row pattern regular expressions ('+' or ''. list of String) */ + List *defineVariableList; /* list of row pattern definition variables (list of String) */ + List *defineClauseList; /* expression for row pattern definition + * search conditions ExprState list */ + List *defineInitial; /* list of row pattern definition variable initials (list of String) */ + MemoryContext partcontext; /* context for partition-lifespan data */ MemoryContext aggcontext; /* shared context for aggregate working data */ MemoryContext curaggcontext; /* current aggregate's working data */ @@ -2555,6 +2564,16 @@ typedef struct WindowAggState TupleTableSlot *agg_row_slot; TupleTableSlot *temp_slot_1; TupleTableSlot *temp_slot_2; + + /* temporary slots for RPR */ + TupleTableSlot *prev_slot; /* PREV row navigation operator */ + TupleTableSlot *next_slot; /* NEXT row navigation operator */ + TupleTableSlot *null_slot; /* all NULL slot */ + + /* head of the reduced window frame */ + int64 headpos_in_reduced_frame; + /* number of rows in the reduced window frame */ + int64 num_rows_in_reduced_frame; } WindowAggState; /* ---------------- diff --git a/src/include/windowapi.h b/src/include/windowapi.h index b8c2c565d1..1e292648e9 100644 --- a/src/include/windowapi.h +++ b/src/include/windowapi.h @@ -58,7 +58,15 @@ extern Datum WinGetFuncArgInFrame(WindowObject winobj, int argno, int relpos, int seektype, bool set_mark, bool *isnull, bool *isout); +extern int WinGetSlotInFrame(WindowObject winobj, TupleTableSlot *slot, + int relpos, int seektype, bool set_mark, + bool *isnull, bool *isout); + extern Datum WinGetFuncArgCurrent(WindowObject winobj, int argno, bool *isnull); +extern WindowAggState *WinGetAggState(WindowObject winobj); + +extern bool window_gettupleslot(WindowObject winobj, int64 pos, TupleTableSlot *slot); + #endif /* WINDOWAPI_H */ -- 2.25.1 ----Next_Part(Wed_Aug__9_17_41_12_2023_134)-- Content-Type: Text/X-Patch; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="v4-0005-Row-pattern-recognition-patch-docs.patch" ^ permalink raw reply [nested|flat] 34+ messages in thread
* [PATCH v1] Mark object class descriptions for translation @ 2026-07-03 06:06 Kyotaro Horiguchi <[email protected]> 0 siblings, 0 replies; 34+ messages in thread From: Kyotaro Horiguchi @ 2026-07-03 06:06 UTC (permalink / raw) ObjectPropertyType.class_descr was originally intended for internal error messages, but is now also used in a translated error message. Mark the object class descriptions for translation and translate the return value of get_object_class_descr(). --- src/backend/catalog/objectaddress.c | 88 ++++++++++++++--------------- src/backend/catalog/pg_depend.c | 2 +- 2 files changed, 45 insertions(+), 45 deletions(-) diff --git a/src/backend/catalog/objectaddress.c b/src/backend/catalog/objectaddress.c index af0e4703616..12dc76b712a 100644 --- a/src/backend/catalog/objectaddress.c +++ b/src/backend/catalog/objectaddress.c @@ -100,8 +100,8 @@ */ typedef struct { - const char *class_descr; /* string describing the catalog, for internal - * error messages */ + const char *class_descr; /* string describing the catalog, for error + * messages */ Oid class_oid; /* oid of catalog */ Oid oid_index_oid; /* oid of index on system oid column */ SysCacheIdentifier oid_catcache_id; /* id of catcache on system oid column */ @@ -124,7 +124,7 @@ typedef struct static const ObjectPropertyType ObjectProperty[] = { { - "access method", + gettext_noop("access method"), AccessMethodRelationId, AmOidIndexId, AMOID, @@ -138,7 +138,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "access method operator", + gettext_noop("access method operator"), AccessMethodOperatorRelationId, AccessMethodOperatorOidIndexId, SYSCACHEID_INVALID, @@ -152,7 +152,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "access method procedure", + gettext_noop("access method procedure"), AccessMethodProcedureRelationId, AccessMethodProcedureOidIndexId, SYSCACHEID_INVALID, @@ -166,7 +166,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "cast", + gettext_noop("cast"), CastRelationId, CastOidIndexId, SYSCACHEID_INVALID, @@ -180,7 +180,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "collation", + gettext_noop("collation"), CollationRelationId, CollationOidIndexId, COLLOID, @@ -194,7 +194,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "constraint", + gettext_noop("constraint"), ConstraintRelationId, ConstraintOidIndexId, CONSTROID, @@ -208,7 +208,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "conversion", + gettext_noop("conversion"), ConversionRelationId, ConversionOidIndexId, CONVOID, @@ -222,7 +222,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "database", + gettext_noop("database"), DatabaseRelationId, DatabaseOidIndexId, DATABASEOID, @@ -236,7 +236,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "default ACL", + gettext_noop("default ACL"), DefaultAclRelationId, DefaultAclOidIndexId, SYSCACHEID_INVALID, @@ -250,7 +250,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "extension", + gettext_noop("extension"), ExtensionRelationId, ExtensionOidIndexId, SYSCACHEID_INVALID, @@ -264,7 +264,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "foreign-data wrapper", + gettext_noop("foreign-data wrapper"), ForeignDataWrapperRelationId, ForeignDataWrapperOidIndexId, FOREIGNDATAWRAPPEROID, @@ -278,7 +278,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "foreign server", + gettext_noop("foreign server"), ForeignServerRelationId, ForeignServerOidIndexId, FOREIGNSERVEROID, @@ -292,7 +292,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "function", + gettext_noop("function"), ProcedureRelationId, ProcedureOidIndexId, PROCOID, @@ -306,7 +306,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "language", + gettext_noop("language"), LanguageRelationId, LanguageOidIndexId, LANGOID, @@ -320,7 +320,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "large object metadata", + gettext_noop("large object metadata"), LargeObjectMetadataRelationId, LargeObjectMetadataOidIndexId, SYSCACHEID_INVALID, @@ -334,7 +334,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "operator class", + gettext_noop("operator class"), OperatorClassRelationId, OpclassOidIndexId, CLAOID, @@ -348,7 +348,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "operator", + gettext_noop("operator"), OperatorRelationId, OperatorOidIndexId, OPEROID, @@ -362,7 +362,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "operator family", + gettext_noop("operator family"), OperatorFamilyRelationId, OpfamilyOidIndexId, OPFAMILYOID, @@ -376,7 +376,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "property graph element", + gettext_noop("property graph element"), PropgraphElementRelationId, PropgraphElementObjectIndexId, PROPGRAPHELOID, @@ -390,7 +390,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph element label", + gettext_noop("property graph element label"), PropgraphElementLabelRelationId, PropgraphElementLabelObjectIndexId, -1, @@ -404,7 +404,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph label", + gettext_noop("property graph label"), PropgraphLabelRelationId, PropgraphLabelObjectIndexId, PROPGRAPHLABELOID, @@ -418,7 +418,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph label property", + gettext_noop("property graph label property"), PropgraphLabelPropertyRelationId, PropgraphLabelPropertyObjectIndexId, -1, @@ -432,7 +432,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph property", + gettext_noop("property graph property"), PropgraphPropertyRelationId, PropgraphPropertyObjectIndexId, -1, @@ -446,7 +446,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "role", + gettext_noop("role"), AuthIdRelationId, AuthIdOidIndexId, AUTHOID, @@ -460,7 +460,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "role membership", + gettext_noop("role membership"), AuthMemRelationId, AuthMemOidIndexId, SYSCACHEID_INVALID, @@ -474,7 +474,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "rule", + gettext_noop("rule"), RewriteRelationId, RewriteOidIndexId, SYSCACHEID_INVALID, @@ -488,7 +488,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "schema", + gettext_noop("schema"), NamespaceRelationId, NamespaceOidIndexId, NAMESPACEOID, @@ -502,7 +502,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "relation", + gettext_noop("relation"), RelationRelationId, ClassOidIndexId, RELOID, @@ -516,7 +516,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "tablespace", + gettext_noop("tablespace"), TableSpaceRelationId, TablespaceOidIndexId, TABLESPACEOID, @@ -530,7 +530,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "transform", + gettext_noop("transform"), TransformRelationId, TransformOidIndexId, TRFOID, @@ -544,7 +544,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "trigger", + gettext_noop("trigger"), TriggerRelationId, TriggerOidIndexId, SYSCACHEID_INVALID, @@ -558,7 +558,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "policy", + gettext_noop("policy"), PolicyRelationId, PolicyOidIndexId, SYSCACHEID_INVALID, @@ -572,7 +572,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "event trigger", + gettext_noop("event trigger"), EventTriggerRelationId, EventTriggerOidIndexId, EVENTTRIGGEROID, @@ -586,7 +586,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search configuration", + gettext_noop("text search configuration"), TSConfigRelationId, TSConfigOidIndexId, TSCONFIGOID, @@ -600,7 +600,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search dictionary", + gettext_noop("text search dictionary"), TSDictionaryRelationId, TSDictionaryOidIndexId, TSDICTOID, @@ -614,7 +614,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search parser", + gettext_noop("text search parser"), TSParserRelationId, TSParserOidIndexId, TSPARSEROID, @@ -628,7 +628,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search template", + gettext_noop("text search template"), TSTemplateRelationId, TSTemplateOidIndexId, TSTEMPLATEOID, @@ -642,7 +642,7 @@ static const ObjectPropertyType ObjectProperty[] = true, }, { - "type", + gettext_noop("type"), TypeRelationId, TypeOidIndexId, TYPEOID, @@ -656,7 +656,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "publication", + gettext_noop("publication"), PublicationRelationId, PublicationObjectIndexId, PUBLICATIONOID, @@ -670,7 +670,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "subscription", + gettext_noop("subscription"), SubscriptionRelationId, SubscriptionObjectIndexId, SUBSCRIPTIONOID, @@ -684,7 +684,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "extended statistics", + gettext_noop("extended statistics"), StatisticExtRelationId, StatisticExtOidIndexId, STATEXTOID, @@ -698,7 +698,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "user mapping", + gettext_noop("user mapping"), UserMappingRelationId, UserMappingOidIndexId, USERMAPPINGOID, diff --git a/src/backend/catalog/pg_depend.c b/src/backend/catalog/pg_depend.c index 9a7a401aced..0d28d34412d 100644 --- a/src/backend/catalog/pg_depend.c +++ b/src/backend/catalog/pg_depend.c @@ -810,7 +810,7 @@ dependencyLockAndCheckObject(Oid classId, Oid objectId) ereport(ERROR, (errcode(ERRCODE_UNDEFINED_OBJECT), errmsg("referenced %s was concurrently dropped", - get_object_class_descr(classId)))); + _(get_object_class_descr(classId))))); systable_endscan(scan); table_close(rel, AccessShareLock); -- 2.52.0 ----Next_Part(Fri_Jul__3_15_37_42_2026_665)---- ^ permalink raw reply [nested|flat] 34+ messages in thread
* [PATCH v1] Mark object class descriptions for translation @ 2026-07-03 06:06 Kyotaro Horiguchi <[email protected]> 0 siblings, 0 replies; 34+ messages in thread From: Kyotaro Horiguchi @ 2026-07-03 06:06 UTC (permalink / raw) ObjectPropertyType.class_descr was originally intended for internal error messages, but is now also used in a translated error message. Mark the object class descriptions for translation and translate the return value of get_object_class_descr(). --- src/backend/catalog/objectaddress.c | 88 ++++++++++++++--------------- src/backend/catalog/pg_depend.c | 2 +- 2 files changed, 45 insertions(+), 45 deletions(-) diff --git a/src/backend/catalog/objectaddress.c b/src/backend/catalog/objectaddress.c index af0e4703616..12dc76b712a 100644 --- a/src/backend/catalog/objectaddress.c +++ b/src/backend/catalog/objectaddress.c @@ -100,8 +100,8 @@ */ typedef struct { - const char *class_descr; /* string describing the catalog, for internal - * error messages */ + const char *class_descr; /* string describing the catalog, for error + * messages */ Oid class_oid; /* oid of catalog */ Oid oid_index_oid; /* oid of index on system oid column */ SysCacheIdentifier oid_catcache_id; /* id of catcache on system oid column */ @@ -124,7 +124,7 @@ typedef struct static const ObjectPropertyType ObjectProperty[] = { { - "access method", + gettext_noop("access method"), AccessMethodRelationId, AmOidIndexId, AMOID, @@ -138,7 +138,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "access method operator", + gettext_noop("access method operator"), AccessMethodOperatorRelationId, AccessMethodOperatorOidIndexId, SYSCACHEID_INVALID, @@ -152,7 +152,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "access method procedure", + gettext_noop("access method procedure"), AccessMethodProcedureRelationId, AccessMethodProcedureOidIndexId, SYSCACHEID_INVALID, @@ -166,7 +166,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "cast", + gettext_noop("cast"), CastRelationId, CastOidIndexId, SYSCACHEID_INVALID, @@ -180,7 +180,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "collation", + gettext_noop("collation"), CollationRelationId, CollationOidIndexId, COLLOID, @@ -194,7 +194,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "constraint", + gettext_noop("constraint"), ConstraintRelationId, ConstraintOidIndexId, CONSTROID, @@ -208,7 +208,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "conversion", + gettext_noop("conversion"), ConversionRelationId, ConversionOidIndexId, CONVOID, @@ -222,7 +222,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "database", + gettext_noop("database"), DatabaseRelationId, DatabaseOidIndexId, DATABASEOID, @@ -236,7 +236,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "default ACL", + gettext_noop("default ACL"), DefaultAclRelationId, DefaultAclOidIndexId, SYSCACHEID_INVALID, @@ -250,7 +250,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "extension", + gettext_noop("extension"), ExtensionRelationId, ExtensionOidIndexId, SYSCACHEID_INVALID, @@ -264,7 +264,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "foreign-data wrapper", + gettext_noop("foreign-data wrapper"), ForeignDataWrapperRelationId, ForeignDataWrapperOidIndexId, FOREIGNDATAWRAPPEROID, @@ -278,7 +278,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "foreign server", + gettext_noop("foreign server"), ForeignServerRelationId, ForeignServerOidIndexId, FOREIGNSERVEROID, @@ -292,7 +292,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "function", + gettext_noop("function"), ProcedureRelationId, ProcedureOidIndexId, PROCOID, @@ -306,7 +306,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "language", + gettext_noop("language"), LanguageRelationId, LanguageOidIndexId, LANGOID, @@ -320,7 +320,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "large object metadata", + gettext_noop("large object metadata"), LargeObjectMetadataRelationId, LargeObjectMetadataOidIndexId, SYSCACHEID_INVALID, @@ -334,7 +334,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "operator class", + gettext_noop("operator class"), OperatorClassRelationId, OpclassOidIndexId, CLAOID, @@ -348,7 +348,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "operator", + gettext_noop("operator"), OperatorRelationId, OperatorOidIndexId, OPEROID, @@ -362,7 +362,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "operator family", + gettext_noop("operator family"), OperatorFamilyRelationId, OpfamilyOidIndexId, OPFAMILYOID, @@ -376,7 +376,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "property graph element", + gettext_noop("property graph element"), PropgraphElementRelationId, PropgraphElementObjectIndexId, PROPGRAPHELOID, @@ -390,7 +390,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph element label", + gettext_noop("property graph element label"), PropgraphElementLabelRelationId, PropgraphElementLabelObjectIndexId, -1, @@ -404,7 +404,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph label", + gettext_noop("property graph label"), PropgraphLabelRelationId, PropgraphLabelObjectIndexId, PROPGRAPHLABELOID, @@ -418,7 +418,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph label property", + gettext_noop("property graph label property"), PropgraphLabelPropertyRelationId, PropgraphLabelPropertyObjectIndexId, -1, @@ -432,7 +432,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph property", + gettext_noop("property graph property"), PropgraphPropertyRelationId, PropgraphPropertyObjectIndexId, -1, @@ -446,7 +446,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "role", + gettext_noop("role"), AuthIdRelationId, AuthIdOidIndexId, AUTHOID, @@ -460,7 +460,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "role membership", + gettext_noop("role membership"), AuthMemRelationId, AuthMemOidIndexId, SYSCACHEID_INVALID, @@ -474,7 +474,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "rule", + gettext_noop("rule"), RewriteRelationId, RewriteOidIndexId, SYSCACHEID_INVALID, @@ -488,7 +488,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "schema", + gettext_noop("schema"), NamespaceRelationId, NamespaceOidIndexId, NAMESPACEOID, @@ -502,7 +502,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "relation", + gettext_noop("relation"), RelationRelationId, ClassOidIndexId, RELOID, @@ -516,7 +516,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "tablespace", + gettext_noop("tablespace"), TableSpaceRelationId, TablespaceOidIndexId, TABLESPACEOID, @@ -530,7 +530,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "transform", + gettext_noop("transform"), TransformRelationId, TransformOidIndexId, TRFOID, @@ -544,7 +544,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "trigger", + gettext_noop("trigger"), TriggerRelationId, TriggerOidIndexId, SYSCACHEID_INVALID, @@ -558,7 +558,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "policy", + gettext_noop("policy"), PolicyRelationId, PolicyOidIndexId, SYSCACHEID_INVALID, @@ -572,7 +572,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "event trigger", + gettext_noop("event trigger"), EventTriggerRelationId, EventTriggerOidIndexId, EVENTTRIGGEROID, @@ -586,7 +586,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search configuration", + gettext_noop("text search configuration"), TSConfigRelationId, TSConfigOidIndexId, TSCONFIGOID, @@ -600,7 +600,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search dictionary", + gettext_noop("text search dictionary"), TSDictionaryRelationId, TSDictionaryOidIndexId, TSDICTOID, @@ -614,7 +614,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search parser", + gettext_noop("text search parser"), TSParserRelationId, TSParserOidIndexId, TSPARSEROID, @@ -628,7 +628,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search template", + gettext_noop("text search template"), TSTemplateRelationId, TSTemplateOidIndexId, TSTEMPLATEOID, @@ -642,7 +642,7 @@ static const ObjectPropertyType ObjectProperty[] = true, }, { - "type", + gettext_noop("type"), TypeRelationId, TypeOidIndexId, TYPEOID, @@ -656,7 +656,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "publication", + gettext_noop("publication"), PublicationRelationId, PublicationObjectIndexId, PUBLICATIONOID, @@ -670,7 +670,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "subscription", + gettext_noop("subscription"), SubscriptionRelationId, SubscriptionObjectIndexId, SUBSCRIPTIONOID, @@ -684,7 +684,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "extended statistics", + gettext_noop("extended statistics"), StatisticExtRelationId, StatisticExtOidIndexId, STATEXTOID, @@ -698,7 +698,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "user mapping", + gettext_noop("user mapping"), UserMappingRelationId, UserMappingOidIndexId, USERMAPPINGOID, diff --git a/src/backend/catalog/pg_depend.c b/src/backend/catalog/pg_depend.c index 9a7a401aced..0d28d34412d 100644 --- a/src/backend/catalog/pg_depend.c +++ b/src/backend/catalog/pg_depend.c @@ -810,7 +810,7 @@ dependencyLockAndCheckObject(Oid classId, Oid objectId) ereport(ERROR, (errcode(ERRCODE_UNDEFINED_OBJECT), errmsg("referenced %s was concurrently dropped", - get_object_class_descr(classId)))); + _(get_object_class_descr(classId))))); systable_endscan(scan); table_close(rel, AccessShareLock); -- 2.52.0 ----Next_Part(Fri_Jul__3_15_37_42_2026_665)---- ^ permalink raw reply [nested|flat] 34+ messages in thread
* [PATCH v1] Mark object class descriptions for translation @ 2026-07-03 06:06 Kyotaro Horiguchi <[email protected]> 0 siblings, 0 replies; 34+ messages in thread From: Kyotaro Horiguchi @ 2026-07-03 06:06 UTC (permalink / raw) ObjectPropertyType.class_descr was originally intended for internal error messages, but is now also used in a translated error message. Mark the object class descriptions for translation and translate the return value of get_object_class_descr(). --- src/backend/catalog/objectaddress.c | 88 ++++++++++++++--------------- src/backend/catalog/pg_depend.c | 2 +- 2 files changed, 45 insertions(+), 45 deletions(-) diff --git a/src/backend/catalog/objectaddress.c b/src/backend/catalog/objectaddress.c index af0e4703616..12dc76b712a 100644 --- a/src/backend/catalog/objectaddress.c +++ b/src/backend/catalog/objectaddress.c @@ -100,8 +100,8 @@ */ typedef struct { - const char *class_descr; /* string describing the catalog, for internal - * error messages */ + const char *class_descr; /* string describing the catalog, for error + * messages */ Oid class_oid; /* oid of catalog */ Oid oid_index_oid; /* oid of index on system oid column */ SysCacheIdentifier oid_catcache_id; /* id of catcache on system oid column */ @@ -124,7 +124,7 @@ typedef struct static const ObjectPropertyType ObjectProperty[] = { { - "access method", + gettext_noop("access method"), AccessMethodRelationId, AmOidIndexId, AMOID, @@ -138,7 +138,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "access method operator", + gettext_noop("access method operator"), AccessMethodOperatorRelationId, AccessMethodOperatorOidIndexId, SYSCACHEID_INVALID, @@ -152,7 +152,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "access method procedure", + gettext_noop("access method procedure"), AccessMethodProcedureRelationId, AccessMethodProcedureOidIndexId, SYSCACHEID_INVALID, @@ -166,7 +166,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "cast", + gettext_noop("cast"), CastRelationId, CastOidIndexId, SYSCACHEID_INVALID, @@ -180,7 +180,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "collation", + gettext_noop("collation"), CollationRelationId, CollationOidIndexId, COLLOID, @@ -194,7 +194,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "constraint", + gettext_noop("constraint"), ConstraintRelationId, ConstraintOidIndexId, CONSTROID, @@ -208,7 +208,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "conversion", + gettext_noop("conversion"), ConversionRelationId, ConversionOidIndexId, CONVOID, @@ -222,7 +222,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "database", + gettext_noop("database"), DatabaseRelationId, DatabaseOidIndexId, DATABASEOID, @@ -236,7 +236,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "default ACL", + gettext_noop("default ACL"), DefaultAclRelationId, DefaultAclOidIndexId, SYSCACHEID_INVALID, @@ -250,7 +250,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "extension", + gettext_noop("extension"), ExtensionRelationId, ExtensionOidIndexId, SYSCACHEID_INVALID, @@ -264,7 +264,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "foreign-data wrapper", + gettext_noop("foreign-data wrapper"), ForeignDataWrapperRelationId, ForeignDataWrapperOidIndexId, FOREIGNDATAWRAPPEROID, @@ -278,7 +278,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "foreign server", + gettext_noop("foreign server"), ForeignServerRelationId, ForeignServerOidIndexId, FOREIGNSERVEROID, @@ -292,7 +292,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "function", + gettext_noop("function"), ProcedureRelationId, ProcedureOidIndexId, PROCOID, @@ -306,7 +306,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "language", + gettext_noop("language"), LanguageRelationId, LanguageOidIndexId, LANGOID, @@ -320,7 +320,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "large object metadata", + gettext_noop("large object metadata"), LargeObjectMetadataRelationId, LargeObjectMetadataOidIndexId, SYSCACHEID_INVALID, @@ -334,7 +334,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "operator class", + gettext_noop("operator class"), OperatorClassRelationId, OpclassOidIndexId, CLAOID, @@ -348,7 +348,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "operator", + gettext_noop("operator"), OperatorRelationId, OperatorOidIndexId, OPEROID, @@ -362,7 +362,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "operator family", + gettext_noop("operator family"), OperatorFamilyRelationId, OpfamilyOidIndexId, OPFAMILYOID, @@ -376,7 +376,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "property graph element", + gettext_noop("property graph element"), PropgraphElementRelationId, PropgraphElementObjectIndexId, PROPGRAPHELOID, @@ -390,7 +390,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph element label", + gettext_noop("property graph element label"), PropgraphElementLabelRelationId, PropgraphElementLabelObjectIndexId, -1, @@ -404,7 +404,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph label", + gettext_noop("property graph label"), PropgraphLabelRelationId, PropgraphLabelObjectIndexId, PROPGRAPHLABELOID, @@ -418,7 +418,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph label property", + gettext_noop("property graph label property"), PropgraphLabelPropertyRelationId, PropgraphLabelPropertyObjectIndexId, -1, @@ -432,7 +432,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph property", + gettext_noop("property graph property"), PropgraphPropertyRelationId, PropgraphPropertyObjectIndexId, -1, @@ -446,7 +446,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "role", + gettext_noop("role"), AuthIdRelationId, AuthIdOidIndexId, AUTHOID, @@ -460,7 +460,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "role membership", + gettext_noop("role membership"), AuthMemRelationId, AuthMemOidIndexId, SYSCACHEID_INVALID, @@ -474,7 +474,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "rule", + gettext_noop("rule"), RewriteRelationId, RewriteOidIndexId, SYSCACHEID_INVALID, @@ -488,7 +488,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "schema", + gettext_noop("schema"), NamespaceRelationId, NamespaceOidIndexId, NAMESPACEOID, @@ -502,7 +502,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "relation", + gettext_noop("relation"), RelationRelationId, ClassOidIndexId, RELOID, @@ -516,7 +516,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "tablespace", + gettext_noop("tablespace"), TableSpaceRelationId, TablespaceOidIndexId, TABLESPACEOID, @@ -530,7 +530,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "transform", + gettext_noop("transform"), TransformRelationId, TransformOidIndexId, TRFOID, @@ -544,7 +544,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "trigger", + gettext_noop("trigger"), TriggerRelationId, TriggerOidIndexId, SYSCACHEID_INVALID, @@ -558,7 +558,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "policy", + gettext_noop("policy"), PolicyRelationId, PolicyOidIndexId, SYSCACHEID_INVALID, @@ -572,7 +572,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "event trigger", + gettext_noop("event trigger"), EventTriggerRelationId, EventTriggerOidIndexId, EVENTTRIGGEROID, @@ -586,7 +586,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search configuration", + gettext_noop("text search configuration"), TSConfigRelationId, TSConfigOidIndexId, TSCONFIGOID, @@ -600,7 +600,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search dictionary", + gettext_noop("text search dictionary"), TSDictionaryRelationId, TSDictionaryOidIndexId, TSDICTOID, @@ -614,7 +614,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search parser", + gettext_noop("text search parser"), TSParserRelationId, TSParserOidIndexId, TSPARSEROID, @@ -628,7 +628,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search template", + gettext_noop("text search template"), TSTemplateRelationId, TSTemplateOidIndexId, TSTEMPLATEOID, @@ -642,7 +642,7 @@ static const ObjectPropertyType ObjectProperty[] = true, }, { - "type", + gettext_noop("type"), TypeRelationId, TypeOidIndexId, TYPEOID, @@ -656,7 +656,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "publication", + gettext_noop("publication"), PublicationRelationId, PublicationObjectIndexId, PUBLICATIONOID, @@ -670,7 +670,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "subscription", + gettext_noop("subscription"), SubscriptionRelationId, SubscriptionObjectIndexId, SUBSCRIPTIONOID, @@ -684,7 +684,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "extended statistics", + gettext_noop("extended statistics"), StatisticExtRelationId, StatisticExtOidIndexId, STATEXTOID, @@ -698,7 +698,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "user mapping", + gettext_noop("user mapping"), UserMappingRelationId, UserMappingOidIndexId, USERMAPPINGOID, diff --git a/src/backend/catalog/pg_depend.c b/src/backend/catalog/pg_depend.c index 9a7a401aced..0d28d34412d 100644 --- a/src/backend/catalog/pg_depend.c +++ b/src/backend/catalog/pg_depend.c @@ -810,7 +810,7 @@ dependencyLockAndCheckObject(Oid classId, Oid objectId) ereport(ERROR, (errcode(ERRCODE_UNDEFINED_OBJECT), errmsg("referenced %s was concurrently dropped", - get_object_class_descr(classId)))); + _(get_object_class_descr(classId))))); systable_endscan(scan); table_close(rel, AccessShareLock); -- 2.52.0 ----Next_Part(Fri_Jul__3_15_37_42_2026_665)---- ^ permalink raw reply [nested|flat] 34+ messages in thread
* [PATCH v1] Mark object class descriptions for translation @ 2026-07-03 06:06 Kyotaro Horiguchi <[email protected]> 0 siblings, 0 replies; 34+ messages in thread From: Kyotaro Horiguchi @ 2026-07-03 06:06 UTC (permalink / raw) ObjectPropertyType.class_descr was originally intended for internal error messages, but is now also used in a translated error message. Mark the object class descriptions for translation and translate the return value of get_object_class_descr(). --- src/backend/catalog/objectaddress.c | 88 ++++++++++++++--------------- src/backend/catalog/pg_depend.c | 2 +- 2 files changed, 45 insertions(+), 45 deletions(-) diff --git a/src/backend/catalog/objectaddress.c b/src/backend/catalog/objectaddress.c index af0e4703616..12dc76b712a 100644 --- a/src/backend/catalog/objectaddress.c +++ b/src/backend/catalog/objectaddress.c @@ -100,8 +100,8 @@ */ typedef struct { - const char *class_descr; /* string describing the catalog, for internal - * error messages */ + const char *class_descr; /* string describing the catalog, for error + * messages */ Oid class_oid; /* oid of catalog */ Oid oid_index_oid; /* oid of index on system oid column */ SysCacheIdentifier oid_catcache_id; /* id of catcache on system oid column */ @@ -124,7 +124,7 @@ typedef struct static const ObjectPropertyType ObjectProperty[] = { { - "access method", + gettext_noop("access method"), AccessMethodRelationId, AmOidIndexId, AMOID, @@ -138,7 +138,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "access method operator", + gettext_noop("access method operator"), AccessMethodOperatorRelationId, AccessMethodOperatorOidIndexId, SYSCACHEID_INVALID, @@ -152,7 +152,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "access method procedure", + gettext_noop("access method procedure"), AccessMethodProcedureRelationId, AccessMethodProcedureOidIndexId, SYSCACHEID_INVALID, @@ -166,7 +166,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "cast", + gettext_noop("cast"), CastRelationId, CastOidIndexId, SYSCACHEID_INVALID, @@ -180,7 +180,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "collation", + gettext_noop("collation"), CollationRelationId, CollationOidIndexId, COLLOID, @@ -194,7 +194,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "constraint", + gettext_noop("constraint"), ConstraintRelationId, ConstraintOidIndexId, CONSTROID, @@ -208,7 +208,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "conversion", + gettext_noop("conversion"), ConversionRelationId, ConversionOidIndexId, CONVOID, @@ -222,7 +222,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "database", + gettext_noop("database"), DatabaseRelationId, DatabaseOidIndexId, DATABASEOID, @@ -236,7 +236,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "default ACL", + gettext_noop("default ACL"), DefaultAclRelationId, DefaultAclOidIndexId, SYSCACHEID_INVALID, @@ -250,7 +250,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "extension", + gettext_noop("extension"), ExtensionRelationId, ExtensionOidIndexId, SYSCACHEID_INVALID, @@ -264,7 +264,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "foreign-data wrapper", + gettext_noop("foreign-data wrapper"), ForeignDataWrapperRelationId, ForeignDataWrapperOidIndexId, FOREIGNDATAWRAPPEROID, @@ -278,7 +278,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "foreign server", + gettext_noop("foreign server"), ForeignServerRelationId, ForeignServerOidIndexId, FOREIGNSERVEROID, @@ -292,7 +292,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "function", + gettext_noop("function"), ProcedureRelationId, ProcedureOidIndexId, PROCOID, @@ -306,7 +306,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "language", + gettext_noop("language"), LanguageRelationId, LanguageOidIndexId, LANGOID, @@ -320,7 +320,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "large object metadata", + gettext_noop("large object metadata"), LargeObjectMetadataRelationId, LargeObjectMetadataOidIndexId, SYSCACHEID_INVALID, @@ -334,7 +334,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "operator class", + gettext_noop("operator class"), OperatorClassRelationId, OpclassOidIndexId, CLAOID, @@ -348,7 +348,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "operator", + gettext_noop("operator"), OperatorRelationId, OperatorOidIndexId, OPEROID, @@ -362,7 +362,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "operator family", + gettext_noop("operator family"), OperatorFamilyRelationId, OpfamilyOidIndexId, OPFAMILYOID, @@ -376,7 +376,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "property graph element", + gettext_noop("property graph element"), PropgraphElementRelationId, PropgraphElementObjectIndexId, PROPGRAPHELOID, @@ -390,7 +390,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph element label", + gettext_noop("property graph element label"), PropgraphElementLabelRelationId, PropgraphElementLabelObjectIndexId, -1, @@ -404,7 +404,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph label", + gettext_noop("property graph label"), PropgraphLabelRelationId, PropgraphLabelObjectIndexId, PROPGRAPHLABELOID, @@ -418,7 +418,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph label property", + gettext_noop("property graph label property"), PropgraphLabelPropertyRelationId, PropgraphLabelPropertyObjectIndexId, -1, @@ -432,7 +432,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph property", + gettext_noop("property graph property"), PropgraphPropertyRelationId, PropgraphPropertyObjectIndexId, -1, @@ -446,7 +446,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "role", + gettext_noop("role"), AuthIdRelationId, AuthIdOidIndexId, AUTHOID, @@ -460,7 +460,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "role membership", + gettext_noop("role membership"), AuthMemRelationId, AuthMemOidIndexId, SYSCACHEID_INVALID, @@ -474,7 +474,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "rule", + gettext_noop("rule"), RewriteRelationId, RewriteOidIndexId, SYSCACHEID_INVALID, @@ -488,7 +488,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "schema", + gettext_noop("schema"), NamespaceRelationId, NamespaceOidIndexId, NAMESPACEOID, @@ -502,7 +502,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "relation", + gettext_noop("relation"), RelationRelationId, ClassOidIndexId, RELOID, @@ -516,7 +516,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "tablespace", + gettext_noop("tablespace"), TableSpaceRelationId, TablespaceOidIndexId, TABLESPACEOID, @@ -530,7 +530,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "transform", + gettext_noop("transform"), TransformRelationId, TransformOidIndexId, TRFOID, @@ -544,7 +544,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "trigger", + gettext_noop("trigger"), TriggerRelationId, TriggerOidIndexId, SYSCACHEID_INVALID, @@ -558,7 +558,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "policy", + gettext_noop("policy"), PolicyRelationId, PolicyOidIndexId, SYSCACHEID_INVALID, @@ -572,7 +572,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "event trigger", + gettext_noop("event trigger"), EventTriggerRelationId, EventTriggerOidIndexId, EVENTTRIGGEROID, @@ -586,7 +586,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search configuration", + gettext_noop("text search configuration"), TSConfigRelationId, TSConfigOidIndexId, TSCONFIGOID, @@ -600,7 +600,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search dictionary", + gettext_noop("text search dictionary"), TSDictionaryRelationId, TSDictionaryOidIndexId, TSDICTOID, @@ -614,7 +614,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search parser", + gettext_noop("text search parser"), TSParserRelationId, TSParserOidIndexId, TSPARSEROID, @@ -628,7 +628,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search template", + gettext_noop("text search template"), TSTemplateRelationId, TSTemplateOidIndexId, TSTEMPLATEOID, @@ -642,7 +642,7 @@ static const ObjectPropertyType ObjectProperty[] = true, }, { - "type", + gettext_noop("type"), TypeRelationId, TypeOidIndexId, TYPEOID, @@ -656,7 +656,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "publication", + gettext_noop("publication"), PublicationRelationId, PublicationObjectIndexId, PUBLICATIONOID, @@ -670,7 +670,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "subscription", + gettext_noop("subscription"), SubscriptionRelationId, SubscriptionObjectIndexId, SUBSCRIPTIONOID, @@ -684,7 +684,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "extended statistics", + gettext_noop("extended statistics"), StatisticExtRelationId, StatisticExtOidIndexId, STATEXTOID, @@ -698,7 +698,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "user mapping", + gettext_noop("user mapping"), UserMappingRelationId, UserMappingOidIndexId, USERMAPPINGOID, diff --git a/src/backend/catalog/pg_depend.c b/src/backend/catalog/pg_depend.c index 9a7a401aced..0d28d34412d 100644 --- a/src/backend/catalog/pg_depend.c +++ b/src/backend/catalog/pg_depend.c @@ -810,7 +810,7 @@ dependencyLockAndCheckObject(Oid classId, Oid objectId) ereport(ERROR, (errcode(ERRCODE_UNDEFINED_OBJECT), errmsg("referenced %s was concurrently dropped", - get_object_class_descr(classId)))); + _(get_object_class_descr(classId))))); systable_endscan(scan); table_close(rel, AccessShareLock); -- 2.52.0 ----Next_Part(Fri_Jul__3_15_37_42_2026_665)---- ^ permalink raw reply [nested|flat] 34+ messages in thread
* [PATCH v1] Mark object class descriptions for translation @ 2026-07-03 06:06 Kyotaro Horiguchi <[email protected]> 0 siblings, 0 replies; 34+ messages in thread From: Kyotaro Horiguchi @ 2026-07-03 06:06 UTC (permalink / raw) ObjectPropertyType.class_descr was originally intended for internal error messages, but is now also used in a translated error message. Mark the object class descriptions for translation and translate the return value of get_object_class_descr(). --- src/backend/catalog/objectaddress.c | 88 ++++++++++++++--------------- src/backend/catalog/pg_depend.c | 2 +- 2 files changed, 45 insertions(+), 45 deletions(-) diff --git a/src/backend/catalog/objectaddress.c b/src/backend/catalog/objectaddress.c index af0e4703616..12dc76b712a 100644 --- a/src/backend/catalog/objectaddress.c +++ b/src/backend/catalog/objectaddress.c @@ -100,8 +100,8 @@ */ typedef struct { - const char *class_descr; /* string describing the catalog, for internal - * error messages */ + const char *class_descr; /* string describing the catalog, for error + * messages */ Oid class_oid; /* oid of catalog */ Oid oid_index_oid; /* oid of index on system oid column */ SysCacheIdentifier oid_catcache_id; /* id of catcache on system oid column */ @@ -124,7 +124,7 @@ typedef struct static const ObjectPropertyType ObjectProperty[] = { { - "access method", + gettext_noop("access method"), AccessMethodRelationId, AmOidIndexId, AMOID, @@ -138,7 +138,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "access method operator", + gettext_noop("access method operator"), AccessMethodOperatorRelationId, AccessMethodOperatorOidIndexId, SYSCACHEID_INVALID, @@ -152,7 +152,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "access method procedure", + gettext_noop("access method procedure"), AccessMethodProcedureRelationId, AccessMethodProcedureOidIndexId, SYSCACHEID_INVALID, @@ -166,7 +166,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "cast", + gettext_noop("cast"), CastRelationId, CastOidIndexId, SYSCACHEID_INVALID, @@ -180,7 +180,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "collation", + gettext_noop("collation"), CollationRelationId, CollationOidIndexId, COLLOID, @@ -194,7 +194,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "constraint", + gettext_noop("constraint"), ConstraintRelationId, ConstraintOidIndexId, CONSTROID, @@ -208,7 +208,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "conversion", + gettext_noop("conversion"), ConversionRelationId, ConversionOidIndexId, CONVOID, @@ -222,7 +222,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "database", + gettext_noop("database"), DatabaseRelationId, DatabaseOidIndexId, DATABASEOID, @@ -236,7 +236,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "default ACL", + gettext_noop("default ACL"), DefaultAclRelationId, DefaultAclOidIndexId, SYSCACHEID_INVALID, @@ -250,7 +250,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "extension", + gettext_noop("extension"), ExtensionRelationId, ExtensionOidIndexId, SYSCACHEID_INVALID, @@ -264,7 +264,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "foreign-data wrapper", + gettext_noop("foreign-data wrapper"), ForeignDataWrapperRelationId, ForeignDataWrapperOidIndexId, FOREIGNDATAWRAPPEROID, @@ -278,7 +278,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "foreign server", + gettext_noop("foreign server"), ForeignServerRelationId, ForeignServerOidIndexId, FOREIGNSERVEROID, @@ -292,7 +292,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "function", + gettext_noop("function"), ProcedureRelationId, ProcedureOidIndexId, PROCOID, @@ -306,7 +306,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "language", + gettext_noop("language"), LanguageRelationId, LanguageOidIndexId, LANGOID, @@ -320,7 +320,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "large object metadata", + gettext_noop("large object metadata"), LargeObjectMetadataRelationId, LargeObjectMetadataOidIndexId, SYSCACHEID_INVALID, @@ -334,7 +334,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "operator class", + gettext_noop("operator class"), OperatorClassRelationId, OpclassOidIndexId, CLAOID, @@ -348,7 +348,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "operator", + gettext_noop("operator"), OperatorRelationId, OperatorOidIndexId, OPEROID, @@ -362,7 +362,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "operator family", + gettext_noop("operator family"), OperatorFamilyRelationId, OpfamilyOidIndexId, OPFAMILYOID, @@ -376,7 +376,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "property graph element", + gettext_noop("property graph element"), PropgraphElementRelationId, PropgraphElementObjectIndexId, PROPGRAPHELOID, @@ -390,7 +390,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph element label", + gettext_noop("property graph element label"), PropgraphElementLabelRelationId, PropgraphElementLabelObjectIndexId, -1, @@ -404,7 +404,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph label", + gettext_noop("property graph label"), PropgraphLabelRelationId, PropgraphLabelObjectIndexId, PROPGRAPHLABELOID, @@ -418,7 +418,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph label property", + gettext_noop("property graph label property"), PropgraphLabelPropertyRelationId, PropgraphLabelPropertyObjectIndexId, -1, @@ -432,7 +432,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph property", + gettext_noop("property graph property"), PropgraphPropertyRelationId, PropgraphPropertyObjectIndexId, -1, @@ -446,7 +446,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "role", + gettext_noop("role"), AuthIdRelationId, AuthIdOidIndexId, AUTHOID, @@ -460,7 +460,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "role membership", + gettext_noop("role membership"), AuthMemRelationId, AuthMemOidIndexId, SYSCACHEID_INVALID, @@ -474,7 +474,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "rule", + gettext_noop("rule"), RewriteRelationId, RewriteOidIndexId, SYSCACHEID_INVALID, @@ -488,7 +488,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "schema", + gettext_noop("schema"), NamespaceRelationId, NamespaceOidIndexId, NAMESPACEOID, @@ -502,7 +502,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "relation", + gettext_noop("relation"), RelationRelationId, ClassOidIndexId, RELOID, @@ -516,7 +516,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "tablespace", + gettext_noop("tablespace"), TableSpaceRelationId, TablespaceOidIndexId, TABLESPACEOID, @@ -530,7 +530,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "transform", + gettext_noop("transform"), TransformRelationId, TransformOidIndexId, TRFOID, @@ -544,7 +544,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "trigger", + gettext_noop("trigger"), TriggerRelationId, TriggerOidIndexId, SYSCACHEID_INVALID, @@ -558,7 +558,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "policy", + gettext_noop("policy"), PolicyRelationId, PolicyOidIndexId, SYSCACHEID_INVALID, @@ -572,7 +572,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "event trigger", + gettext_noop("event trigger"), EventTriggerRelationId, EventTriggerOidIndexId, EVENTTRIGGEROID, @@ -586,7 +586,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search configuration", + gettext_noop("text search configuration"), TSConfigRelationId, TSConfigOidIndexId, TSCONFIGOID, @@ -600,7 +600,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search dictionary", + gettext_noop("text search dictionary"), TSDictionaryRelationId, TSDictionaryOidIndexId, TSDICTOID, @@ -614,7 +614,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search parser", + gettext_noop("text search parser"), TSParserRelationId, TSParserOidIndexId, TSPARSEROID, @@ -628,7 +628,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search template", + gettext_noop("text search template"), TSTemplateRelationId, TSTemplateOidIndexId, TSTEMPLATEOID, @@ -642,7 +642,7 @@ static const ObjectPropertyType ObjectProperty[] = true, }, { - "type", + gettext_noop("type"), TypeRelationId, TypeOidIndexId, TYPEOID, @@ -656,7 +656,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "publication", + gettext_noop("publication"), PublicationRelationId, PublicationObjectIndexId, PUBLICATIONOID, @@ -670,7 +670,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "subscription", + gettext_noop("subscription"), SubscriptionRelationId, SubscriptionObjectIndexId, SUBSCRIPTIONOID, @@ -684,7 +684,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "extended statistics", + gettext_noop("extended statistics"), StatisticExtRelationId, StatisticExtOidIndexId, STATEXTOID, @@ -698,7 +698,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "user mapping", + gettext_noop("user mapping"), UserMappingRelationId, UserMappingOidIndexId, USERMAPPINGOID, diff --git a/src/backend/catalog/pg_depend.c b/src/backend/catalog/pg_depend.c index 9a7a401aced..0d28d34412d 100644 --- a/src/backend/catalog/pg_depend.c +++ b/src/backend/catalog/pg_depend.c @@ -810,7 +810,7 @@ dependencyLockAndCheckObject(Oid classId, Oid objectId) ereport(ERROR, (errcode(ERRCODE_UNDEFINED_OBJECT), errmsg("referenced %s was concurrently dropped", - get_object_class_descr(classId)))); + _(get_object_class_descr(classId))))); systable_endscan(scan); table_close(rel, AccessShareLock); -- 2.52.0 ----Next_Part(Fri_Jul__3_15_37_42_2026_665)---- ^ permalink raw reply [nested|flat] 34+ messages in thread
* [PATCH v1] Mark object class descriptions for translation @ 2026-07-03 06:06 Kyotaro Horiguchi <[email protected]> 0 siblings, 0 replies; 34+ messages in thread From: Kyotaro Horiguchi @ 2026-07-03 06:06 UTC (permalink / raw) ObjectPropertyType.class_descr was originally intended for internal error messages, but is now also used in a translated error message. Mark the object class descriptions for translation and translate the return value of get_object_class_descr(). --- src/backend/catalog/objectaddress.c | 88 ++++++++++++++--------------- src/backend/catalog/pg_depend.c | 2 +- 2 files changed, 45 insertions(+), 45 deletions(-) diff --git a/src/backend/catalog/objectaddress.c b/src/backend/catalog/objectaddress.c index af0e4703616..12dc76b712a 100644 --- a/src/backend/catalog/objectaddress.c +++ b/src/backend/catalog/objectaddress.c @@ -100,8 +100,8 @@ */ typedef struct { - const char *class_descr; /* string describing the catalog, for internal - * error messages */ + const char *class_descr; /* string describing the catalog, for error + * messages */ Oid class_oid; /* oid of catalog */ Oid oid_index_oid; /* oid of index on system oid column */ SysCacheIdentifier oid_catcache_id; /* id of catcache on system oid column */ @@ -124,7 +124,7 @@ typedef struct static const ObjectPropertyType ObjectProperty[] = { { - "access method", + gettext_noop("access method"), AccessMethodRelationId, AmOidIndexId, AMOID, @@ -138,7 +138,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "access method operator", + gettext_noop("access method operator"), AccessMethodOperatorRelationId, AccessMethodOperatorOidIndexId, SYSCACHEID_INVALID, @@ -152,7 +152,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "access method procedure", + gettext_noop("access method procedure"), AccessMethodProcedureRelationId, AccessMethodProcedureOidIndexId, SYSCACHEID_INVALID, @@ -166,7 +166,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "cast", + gettext_noop("cast"), CastRelationId, CastOidIndexId, SYSCACHEID_INVALID, @@ -180,7 +180,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "collation", + gettext_noop("collation"), CollationRelationId, CollationOidIndexId, COLLOID, @@ -194,7 +194,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "constraint", + gettext_noop("constraint"), ConstraintRelationId, ConstraintOidIndexId, CONSTROID, @@ -208,7 +208,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "conversion", + gettext_noop("conversion"), ConversionRelationId, ConversionOidIndexId, CONVOID, @@ -222,7 +222,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "database", + gettext_noop("database"), DatabaseRelationId, DatabaseOidIndexId, DATABASEOID, @@ -236,7 +236,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "default ACL", + gettext_noop("default ACL"), DefaultAclRelationId, DefaultAclOidIndexId, SYSCACHEID_INVALID, @@ -250,7 +250,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "extension", + gettext_noop("extension"), ExtensionRelationId, ExtensionOidIndexId, SYSCACHEID_INVALID, @@ -264,7 +264,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "foreign-data wrapper", + gettext_noop("foreign-data wrapper"), ForeignDataWrapperRelationId, ForeignDataWrapperOidIndexId, FOREIGNDATAWRAPPEROID, @@ -278,7 +278,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "foreign server", + gettext_noop("foreign server"), ForeignServerRelationId, ForeignServerOidIndexId, FOREIGNSERVEROID, @@ -292,7 +292,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "function", + gettext_noop("function"), ProcedureRelationId, ProcedureOidIndexId, PROCOID, @@ -306,7 +306,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "language", + gettext_noop("language"), LanguageRelationId, LanguageOidIndexId, LANGOID, @@ -320,7 +320,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "large object metadata", + gettext_noop("large object metadata"), LargeObjectMetadataRelationId, LargeObjectMetadataOidIndexId, SYSCACHEID_INVALID, @@ -334,7 +334,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "operator class", + gettext_noop("operator class"), OperatorClassRelationId, OpclassOidIndexId, CLAOID, @@ -348,7 +348,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "operator", + gettext_noop("operator"), OperatorRelationId, OperatorOidIndexId, OPEROID, @@ -362,7 +362,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "operator family", + gettext_noop("operator family"), OperatorFamilyRelationId, OpfamilyOidIndexId, OPFAMILYOID, @@ -376,7 +376,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "property graph element", + gettext_noop("property graph element"), PropgraphElementRelationId, PropgraphElementObjectIndexId, PROPGRAPHELOID, @@ -390,7 +390,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph element label", + gettext_noop("property graph element label"), PropgraphElementLabelRelationId, PropgraphElementLabelObjectIndexId, -1, @@ -404,7 +404,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph label", + gettext_noop("property graph label"), PropgraphLabelRelationId, PropgraphLabelObjectIndexId, PROPGRAPHLABELOID, @@ -418,7 +418,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph label property", + gettext_noop("property graph label property"), PropgraphLabelPropertyRelationId, PropgraphLabelPropertyObjectIndexId, -1, @@ -432,7 +432,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph property", + gettext_noop("property graph property"), PropgraphPropertyRelationId, PropgraphPropertyObjectIndexId, -1, @@ -446,7 +446,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "role", + gettext_noop("role"), AuthIdRelationId, AuthIdOidIndexId, AUTHOID, @@ -460,7 +460,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "role membership", + gettext_noop("role membership"), AuthMemRelationId, AuthMemOidIndexId, SYSCACHEID_INVALID, @@ -474,7 +474,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "rule", + gettext_noop("rule"), RewriteRelationId, RewriteOidIndexId, SYSCACHEID_INVALID, @@ -488,7 +488,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "schema", + gettext_noop("schema"), NamespaceRelationId, NamespaceOidIndexId, NAMESPACEOID, @@ -502,7 +502,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "relation", + gettext_noop("relation"), RelationRelationId, ClassOidIndexId, RELOID, @@ -516,7 +516,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "tablespace", + gettext_noop("tablespace"), TableSpaceRelationId, TablespaceOidIndexId, TABLESPACEOID, @@ -530,7 +530,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "transform", + gettext_noop("transform"), TransformRelationId, TransformOidIndexId, TRFOID, @@ -544,7 +544,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "trigger", + gettext_noop("trigger"), TriggerRelationId, TriggerOidIndexId, SYSCACHEID_INVALID, @@ -558,7 +558,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "policy", + gettext_noop("policy"), PolicyRelationId, PolicyOidIndexId, SYSCACHEID_INVALID, @@ -572,7 +572,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "event trigger", + gettext_noop("event trigger"), EventTriggerRelationId, EventTriggerOidIndexId, EVENTTRIGGEROID, @@ -586,7 +586,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search configuration", + gettext_noop("text search configuration"), TSConfigRelationId, TSConfigOidIndexId, TSCONFIGOID, @@ -600,7 +600,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search dictionary", + gettext_noop("text search dictionary"), TSDictionaryRelationId, TSDictionaryOidIndexId, TSDICTOID, @@ -614,7 +614,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search parser", + gettext_noop("text search parser"), TSParserRelationId, TSParserOidIndexId, TSPARSEROID, @@ -628,7 +628,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search template", + gettext_noop("text search template"), TSTemplateRelationId, TSTemplateOidIndexId, TSTEMPLATEOID, @@ -642,7 +642,7 @@ static const ObjectPropertyType ObjectProperty[] = true, }, { - "type", + gettext_noop("type"), TypeRelationId, TypeOidIndexId, TYPEOID, @@ -656,7 +656,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "publication", + gettext_noop("publication"), PublicationRelationId, PublicationObjectIndexId, PUBLICATIONOID, @@ -670,7 +670,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "subscription", + gettext_noop("subscription"), SubscriptionRelationId, SubscriptionObjectIndexId, SUBSCRIPTIONOID, @@ -684,7 +684,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "extended statistics", + gettext_noop("extended statistics"), StatisticExtRelationId, StatisticExtOidIndexId, STATEXTOID, @@ -698,7 +698,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "user mapping", + gettext_noop("user mapping"), UserMappingRelationId, UserMappingOidIndexId, USERMAPPINGOID, diff --git a/src/backend/catalog/pg_depend.c b/src/backend/catalog/pg_depend.c index 9a7a401aced..0d28d34412d 100644 --- a/src/backend/catalog/pg_depend.c +++ b/src/backend/catalog/pg_depend.c @@ -810,7 +810,7 @@ dependencyLockAndCheckObject(Oid classId, Oid objectId) ereport(ERROR, (errcode(ERRCODE_UNDEFINED_OBJECT), errmsg("referenced %s was concurrently dropped", - get_object_class_descr(classId)))); + _(get_object_class_descr(classId))))); systable_endscan(scan); table_close(rel, AccessShareLock); -- 2.52.0 ----Next_Part(Fri_Jul__3_15_37_42_2026_665)---- ^ permalink raw reply [nested|flat] 34+ messages in thread
* [PATCH v1] Mark object class descriptions for translation @ 2026-07-03 06:06 Kyotaro Horiguchi <[email protected]> 0 siblings, 0 replies; 34+ messages in thread From: Kyotaro Horiguchi @ 2026-07-03 06:06 UTC (permalink / raw) ObjectPropertyType.class_descr was originally intended for internal error messages, but is now also used in a translated error message. Mark the object class descriptions for translation and translate the return value of get_object_class_descr(). --- src/backend/catalog/objectaddress.c | 88 ++++++++++++++--------------- src/backend/catalog/pg_depend.c | 2 +- 2 files changed, 45 insertions(+), 45 deletions(-) diff --git a/src/backend/catalog/objectaddress.c b/src/backend/catalog/objectaddress.c index af0e4703616..12dc76b712a 100644 --- a/src/backend/catalog/objectaddress.c +++ b/src/backend/catalog/objectaddress.c @@ -100,8 +100,8 @@ */ typedef struct { - const char *class_descr; /* string describing the catalog, for internal - * error messages */ + const char *class_descr; /* string describing the catalog, for error + * messages */ Oid class_oid; /* oid of catalog */ Oid oid_index_oid; /* oid of index on system oid column */ SysCacheIdentifier oid_catcache_id; /* id of catcache on system oid column */ @@ -124,7 +124,7 @@ typedef struct static const ObjectPropertyType ObjectProperty[] = { { - "access method", + gettext_noop("access method"), AccessMethodRelationId, AmOidIndexId, AMOID, @@ -138,7 +138,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "access method operator", + gettext_noop("access method operator"), AccessMethodOperatorRelationId, AccessMethodOperatorOidIndexId, SYSCACHEID_INVALID, @@ -152,7 +152,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "access method procedure", + gettext_noop("access method procedure"), AccessMethodProcedureRelationId, AccessMethodProcedureOidIndexId, SYSCACHEID_INVALID, @@ -166,7 +166,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "cast", + gettext_noop("cast"), CastRelationId, CastOidIndexId, SYSCACHEID_INVALID, @@ -180,7 +180,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "collation", + gettext_noop("collation"), CollationRelationId, CollationOidIndexId, COLLOID, @@ -194,7 +194,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "constraint", + gettext_noop("constraint"), ConstraintRelationId, ConstraintOidIndexId, CONSTROID, @@ -208,7 +208,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "conversion", + gettext_noop("conversion"), ConversionRelationId, ConversionOidIndexId, CONVOID, @@ -222,7 +222,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "database", + gettext_noop("database"), DatabaseRelationId, DatabaseOidIndexId, DATABASEOID, @@ -236,7 +236,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "default ACL", + gettext_noop("default ACL"), DefaultAclRelationId, DefaultAclOidIndexId, SYSCACHEID_INVALID, @@ -250,7 +250,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "extension", + gettext_noop("extension"), ExtensionRelationId, ExtensionOidIndexId, SYSCACHEID_INVALID, @@ -264,7 +264,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "foreign-data wrapper", + gettext_noop("foreign-data wrapper"), ForeignDataWrapperRelationId, ForeignDataWrapperOidIndexId, FOREIGNDATAWRAPPEROID, @@ -278,7 +278,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "foreign server", + gettext_noop("foreign server"), ForeignServerRelationId, ForeignServerOidIndexId, FOREIGNSERVEROID, @@ -292,7 +292,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "function", + gettext_noop("function"), ProcedureRelationId, ProcedureOidIndexId, PROCOID, @@ -306,7 +306,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "language", + gettext_noop("language"), LanguageRelationId, LanguageOidIndexId, LANGOID, @@ -320,7 +320,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "large object metadata", + gettext_noop("large object metadata"), LargeObjectMetadataRelationId, LargeObjectMetadataOidIndexId, SYSCACHEID_INVALID, @@ -334,7 +334,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "operator class", + gettext_noop("operator class"), OperatorClassRelationId, OpclassOidIndexId, CLAOID, @@ -348,7 +348,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "operator", + gettext_noop("operator"), OperatorRelationId, OperatorOidIndexId, OPEROID, @@ -362,7 +362,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "operator family", + gettext_noop("operator family"), OperatorFamilyRelationId, OpfamilyOidIndexId, OPFAMILYOID, @@ -376,7 +376,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "property graph element", + gettext_noop("property graph element"), PropgraphElementRelationId, PropgraphElementObjectIndexId, PROPGRAPHELOID, @@ -390,7 +390,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph element label", + gettext_noop("property graph element label"), PropgraphElementLabelRelationId, PropgraphElementLabelObjectIndexId, -1, @@ -404,7 +404,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph label", + gettext_noop("property graph label"), PropgraphLabelRelationId, PropgraphLabelObjectIndexId, PROPGRAPHLABELOID, @@ -418,7 +418,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph label property", + gettext_noop("property graph label property"), PropgraphLabelPropertyRelationId, PropgraphLabelPropertyObjectIndexId, -1, @@ -432,7 +432,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph property", + gettext_noop("property graph property"), PropgraphPropertyRelationId, PropgraphPropertyObjectIndexId, -1, @@ -446,7 +446,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "role", + gettext_noop("role"), AuthIdRelationId, AuthIdOidIndexId, AUTHOID, @@ -460,7 +460,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "role membership", + gettext_noop("role membership"), AuthMemRelationId, AuthMemOidIndexId, SYSCACHEID_INVALID, @@ -474,7 +474,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "rule", + gettext_noop("rule"), RewriteRelationId, RewriteOidIndexId, SYSCACHEID_INVALID, @@ -488,7 +488,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "schema", + gettext_noop("schema"), NamespaceRelationId, NamespaceOidIndexId, NAMESPACEOID, @@ -502,7 +502,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "relation", + gettext_noop("relation"), RelationRelationId, ClassOidIndexId, RELOID, @@ -516,7 +516,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "tablespace", + gettext_noop("tablespace"), TableSpaceRelationId, TablespaceOidIndexId, TABLESPACEOID, @@ -530,7 +530,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "transform", + gettext_noop("transform"), TransformRelationId, TransformOidIndexId, TRFOID, @@ -544,7 +544,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "trigger", + gettext_noop("trigger"), TriggerRelationId, TriggerOidIndexId, SYSCACHEID_INVALID, @@ -558,7 +558,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "policy", + gettext_noop("policy"), PolicyRelationId, PolicyOidIndexId, SYSCACHEID_INVALID, @@ -572,7 +572,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "event trigger", + gettext_noop("event trigger"), EventTriggerRelationId, EventTriggerOidIndexId, EVENTTRIGGEROID, @@ -586,7 +586,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search configuration", + gettext_noop("text search configuration"), TSConfigRelationId, TSConfigOidIndexId, TSCONFIGOID, @@ -600,7 +600,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search dictionary", + gettext_noop("text search dictionary"), TSDictionaryRelationId, TSDictionaryOidIndexId, TSDICTOID, @@ -614,7 +614,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search parser", + gettext_noop("text search parser"), TSParserRelationId, TSParserOidIndexId, TSPARSEROID, @@ -628,7 +628,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search template", + gettext_noop("text search template"), TSTemplateRelationId, TSTemplateOidIndexId, TSTEMPLATEOID, @@ -642,7 +642,7 @@ static const ObjectPropertyType ObjectProperty[] = true, }, { - "type", + gettext_noop("type"), TypeRelationId, TypeOidIndexId, TYPEOID, @@ -656,7 +656,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "publication", + gettext_noop("publication"), PublicationRelationId, PublicationObjectIndexId, PUBLICATIONOID, @@ -670,7 +670,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "subscription", + gettext_noop("subscription"), SubscriptionRelationId, SubscriptionObjectIndexId, SUBSCRIPTIONOID, @@ -684,7 +684,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "extended statistics", + gettext_noop("extended statistics"), StatisticExtRelationId, StatisticExtOidIndexId, STATEXTOID, @@ -698,7 +698,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "user mapping", + gettext_noop("user mapping"), UserMappingRelationId, UserMappingOidIndexId, USERMAPPINGOID, diff --git a/src/backend/catalog/pg_depend.c b/src/backend/catalog/pg_depend.c index 9a7a401aced..0d28d34412d 100644 --- a/src/backend/catalog/pg_depend.c +++ b/src/backend/catalog/pg_depend.c @@ -810,7 +810,7 @@ dependencyLockAndCheckObject(Oid classId, Oid objectId) ereport(ERROR, (errcode(ERRCODE_UNDEFINED_OBJECT), errmsg("referenced %s was concurrently dropped", - get_object_class_descr(classId)))); + _(get_object_class_descr(classId))))); systable_endscan(scan); table_close(rel, AccessShareLock); -- 2.52.0 ----Next_Part(Fri_Jul__3_15_37_42_2026_665)---- ^ permalink raw reply [nested|flat] 34+ messages in thread
* [PATCH v1] Mark object class descriptions for translation @ 2026-07-03 06:06 Kyotaro Horiguchi <[email protected]> 0 siblings, 0 replies; 34+ messages in thread From: Kyotaro Horiguchi @ 2026-07-03 06:06 UTC (permalink / raw) ObjectPropertyType.class_descr was originally intended for internal error messages, but is now also used in a translated error message. Mark the object class descriptions for translation and translate the return value of get_object_class_descr(). --- src/backend/catalog/objectaddress.c | 88 ++++++++++++++--------------- src/backend/catalog/pg_depend.c | 2 +- 2 files changed, 45 insertions(+), 45 deletions(-) diff --git a/src/backend/catalog/objectaddress.c b/src/backend/catalog/objectaddress.c index af0e4703616..12dc76b712a 100644 --- a/src/backend/catalog/objectaddress.c +++ b/src/backend/catalog/objectaddress.c @@ -100,8 +100,8 @@ */ typedef struct { - const char *class_descr; /* string describing the catalog, for internal - * error messages */ + const char *class_descr; /* string describing the catalog, for error + * messages */ Oid class_oid; /* oid of catalog */ Oid oid_index_oid; /* oid of index on system oid column */ SysCacheIdentifier oid_catcache_id; /* id of catcache on system oid column */ @@ -124,7 +124,7 @@ typedef struct static const ObjectPropertyType ObjectProperty[] = { { - "access method", + gettext_noop("access method"), AccessMethodRelationId, AmOidIndexId, AMOID, @@ -138,7 +138,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "access method operator", + gettext_noop("access method operator"), AccessMethodOperatorRelationId, AccessMethodOperatorOidIndexId, SYSCACHEID_INVALID, @@ -152,7 +152,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "access method procedure", + gettext_noop("access method procedure"), AccessMethodProcedureRelationId, AccessMethodProcedureOidIndexId, SYSCACHEID_INVALID, @@ -166,7 +166,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "cast", + gettext_noop("cast"), CastRelationId, CastOidIndexId, SYSCACHEID_INVALID, @@ -180,7 +180,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "collation", + gettext_noop("collation"), CollationRelationId, CollationOidIndexId, COLLOID, @@ -194,7 +194,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "constraint", + gettext_noop("constraint"), ConstraintRelationId, ConstraintOidIndexId, CONSTROID, @@ -208,7 +208,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "conversion", + gettext_noop("conversion"), ConversionRelationId, ConversionOidIndexId, CONVOID, @@ -222,7 +222,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "database", + gettext_noop("database"), DatabaseRelationId, DatabaseOidIndexId, DATABASEOID, @@ -236,7 +236,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "default ACL", + gettext_noop("default ACL"), DefaultAclRelationId, DefaultAclOidIndexId, SYSCACHEID_INVALID, @@ -250,7 +250,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "extension", + gettext_noop("extension"), ExtensionRelationId, ExtensionOidIndexId, SYSCACHEID_INVALID, @@ -264,7 +264,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "foreign-data wrapper", + gettext_noop("foreign-data wrapper"), ForeignDataWrapperRelationId, ForeignDataWrapperOidIndexId, FOREIGNDATAWRAPPEROID, @@ -278,7 +278,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "foreign server", + gettext_noop("foreign server"), ForeignServerRelationId, ForeignServerOidIndexId, FOREIGNSERVEROID, @@ -292,7 +292,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "function", + gettext_noop("function"), ProcedureRelationId, ProcedureOidIndexId, PROCOID, @@ -306,7 +306,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "language", + gettext_noop("language"), LanguageRelationId, LanguageOidIndexId, LANGOID, @@ -320,7 +320,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "large object metadata", + gettext_noop("large object metadata"), LargeObjectMetadataRelationId, LargeObjectMetadataOidIndexId, SYSCACHEID_INVALID, @@ -334,7 +334,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "operator class", + gettext_noop("operator class"), OperatorClassRelationId, OpclassOidIndexId, CLAOID, @@ -348,7 +348,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "operator", + gettext_noop("operator"), OperatorRelationId, OperatorOidIndexId, OPEROID, @@ -362,7 +362,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "operator family", + gettext_noop("operator family"), OperatorFamilyRelationId, OpfamilyOidIndexId, OPFAMILYOID, @@ -376,7 +376,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "property graph element", + gettext_noop("property graph element"), PropgraphElementRelationId, PropgraphElementObjectIndexId, PROPGRAPHELOID, @@ -390,7 +390,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph element label", + gettext_noop("property graph element label"), PropgraphElementLabelRelationId, PropgraphElementLabelObjectIndexId, -1, @@ -404,7 +404,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph label", + gettext_noop("property graph label"), PropgraphLabelRelationId, PropgraphLabelObjectIndexId, PROPGRAPHLABELOID, @@ -418,7 +418,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph label property", + gettext_noop("property graph label property"), PropgraphLabelPropertyRelationId, PropgraphLabelPropertyObjectIndexId, -1, @@ -432,7 +432,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph property", + gettext_noop("property graph property"), PropgraphPropertyRelationId, PropgraphPropertyObjectIndexId, -1, @@ -446,7 +446,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "role", + gettext_noop("role"), AuthIdRelationId, AuthIdOidIndexId, AUTHOID, @@ -460,7 +460,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "role membership", + gettext_noop("role membership"), AuthMemRelationId, AuthMemOidIndexId, SYSCACHEID_INVALID, @@ -474,7 +474,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "rule", + gettext_noop("rule"), RewriteRelationId, RewriteOidIndexId, SYSCACHEID_INVALID, @@ -488,7 +488,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "schema", + gettext_noop("schema"), NamespaceRelationId, NamespaceOidIndexId, NAMESPACEOID, @@ -502,7 +502,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "relation", + gettext_noop("relation"), RelationRelationId, ClassOidIndexId, RELOID, @@ -516,7 +516,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "tablespace", + gettext_noop("tablespace"), TableSpaceRelationId, TablespaceOidIndexId, TABLESPACEOID, @@ -530,7 +530,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "transform", + gettext_noop("transform"), TransformRelationId, TransformOidIndexId, TRFOID, @@ -544,7 +544,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "trigger", + gettext_noop("trigger"), TriggerRelationId, TriggerOidIndexId, SYSCACHEID_INVALID, @@ -558,7 +558,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "policy", + gettext_noop("policy"), PolicyRelationId, PolicyOidIndexId, SYSCACHEID_INVALID, @@ -572,7 +572,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "event trigger", + gettext_noop("event trigger"), EventTriggerRelationId, EventTriggerOidIndexId, EVENTTRIGGEROID, @@ -586,7 +586,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search configuration", + gettext_noop("text search configuration"), TSConfigRelationId, TSConfigOidIndexId, TSCONFIGOID, @@ -600,7 +600,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search dictionary", + gettext_noop("text search dictionary"), TSDictionaryRelationId, TSDictionaryOidIndexId, TSDICTOID, @@ -614,7 +614,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search parser", + gettext_noop("text search parser"), TSParserRelationId, TSParserOidIndexId, TSPARSEROID, @@ -628,7 +628,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search template", + gettext_noop("text search template"), TSTemplateRelationId, TSTemplateOidIndexId, TSTEMPLATEOID, @@ -642,7 +642,7 @@ static const ObjectPropertyType ObjectProperty[] = true, }, { - "type", + gettext_noop("type"), TypeRelationId, TypeOidIndexId, TYPEOID, @@ -656,7 +656,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "publication", + gettext_noop("publication"), PublicationRelationId, PublicationObjectIndexId, PUBLICATIONOID, @@ -670,7 +670,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "subscription", + gettext_noop("subscription"), SubscriptionRelationId, SubscriptionObjectIndexId, SUBSCRIPTIONOID, @@ -684,7 +684,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "extended statistics", + gettext_noop("extended statistics"), StatisticExtRelationId, StatisticExtOidIndexId, STATEXTOID, @@ -698,7 +698,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "user mapping", + gettext_noop("user mapping"), UserMappingRelationId, UserMappingOidIndexId, USERMAPPINGOID, diff --git a/src/backend/catalog/pg_depend.c b/src/backend/catalog/pg_depend.c index 9a7a401aced..0d28d34412d 100644 --- a/src/backend/catalog/pg_depend.c +++ b/src/backend/catalog/pg_depend.c @@ -810,7 +810,7 @@ dependencyLockAndCheckObject(Oid classId, Oid objectId) ereport(ERROR, (errcode(ERRCODE_UNDEFINED_OBJECT), errmsg("referenced %s was concurrently dropped", - get_object_class_descr(classId)))); + _(get_object_class_descr(classId))))); systable_endscan(scan); table_close(rel, AccessShareLock); -- 2.52.0 ----Next_Part(Fri_Jul__3_15_37_42_2026_665)---- ^ permalink raw reply [nested|flat] 34+ messages in thread
* [PATCH v1] Mark object class descriptions for translation @ 2026-07-03 06:06 Kyotaro Horiguchi <[email protected]> 0 siblings, 0 replies; 34+ messages in thread From: Kyotaro Horiguchi @ 2026-07-03 06:06 UTC (permalink / raw) ObjectPropertyType.class_descr was originally intended for internal error messages, but is now also used in a translated error message. Mark the object class descriptions for translation and translate the return value of get_object_class_descr(). --- src/backend/catalog/objectaddress.c | 88 ++++++++++++++--------------- src/backend/catalog/pg_depend.c | 2 +- 2 files changed, 45 insertions(+), 45 deletions(-) diff --git a/src/backend/catalog/objectaddress.c b/src/backend/catalog/objectaddress.c index af0e4703616..12dc76b712a 100644 --- a/src/backend/catalog/objectaddress.c +++ b/src/backend/catalog/objectaddress.c @@ -100,8 +100,8 @@ */ typedef struct { - const char *class_descr; /* string describing the catalog, for internal - * error messages */ + const char *class_descr; /* string describing the catalog, for error + * messages */ Oid class_oid; /* oid of catalog */ Oid oid_index_oid; /* oid of index on system oid column */ SysCacheIdentifier oid_catcache_id; /* id of catcache on system oid column */ @@ -124,7 +124,7 @@ typedef struct static const ObjectPropertyType ObjectProperty[] = { { - "access method", + gettext_noop("access method"), AccessMethodRelationId, AmOidIndexId, AMOID, @@ -138,7 +138,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "access method operator", + gettext_noop("access method operator"), AccessMethodOperatorRelationId, AccessMethodOperatorOidIndexId, SYSCACHEID_INVALID, @@ -152,7 +152,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "access method procedure", + gettext_noop("access method procedure"), AccessMethodProcedureRelationId, AccessMethodProcedureOidIndexId, SYSCACHEID_INVALID, @@ -166,7 +166,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "cast", + gettext_noop("cast"), CastRelationId, CastOidIndexId, SYSCACHEID_INVALID, @@ -180,7 +180,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "collation", + gettext_noop("collation"), CollationRelationId, CollationOidIndexId, COLLOID, @@ -194,7 +194,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "constraint", + gettext_noop("constraint"), ConstraintRelationId, ConstraintOidIndexId, CONSTROID, @@ -208,7 +208,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "conversion", + gettext_noop("conversion"), ConversionRelationId, ConversionOidIndexId, CONVOID, @@ -222,7 +222,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "database", + gettext_noop("database"), DatabaseRelationId, DatabaseOidIndexId, DATABASEOID, @@ -236,7 +236,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "default ACL", + gettext_noop("default ACL"), DefaultAclRelationId, DefaultAclOidIndexId, SYSCACHEID_INVALID, @@ -250,7 +250,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "extension", + gettext_noop("extension"), ExtensionRelationId, ExtensionOidIndexId, SYSCACHEID_INVALID, @@ -264,7 +264,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "foreign-data wrapper", + gettext_noop("foreign-data wrapper"), ForeignDataWrapperRelationId, ForeignDataWrapperOidIndexId, FOREIGNDATAWRAPPEROID, @@ -278,7 +278,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "foreign server", + gettext_noop("foreign server"), ForeignServerRelationId, ForeignServerOidIndexId, FOREIGNSERVEROID, @@ -292,7 +292,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "function", + gettext_noop("function"), ProcedureRelationId, ProcedureOidIndexId, PROCOID, @@ -306,7 +306,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "language", + gettext_noop("language"), LanguageRelationId, LanguageOidIndexId, LANGOID, @@ -320,7 +320,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "large object metadata", + gettext_noop("large object metadata"), LargeObjectMetadataRelationId, LargeObjectMetadataOidIndexId, SYSCACHEID_INVALID, @@ -334,7 +334,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "operator class", + gettext_noop("operator class"), OperatorClassRelationId, OpclassOidIndexId, CLAOID, @@ -348,7 +348,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "operator", + gettext_noop("operator"), OperatorRelationId, OperatorOidIndexId, OPEROID, @@ -362,7 +362,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "operator family", + gettext_noop("operator family"), OperatorFamilyRelationId, OpfamilyOidIndexId, OPFAMILYOID, @@ -376,7 +376,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "property graph element", + gettext_noop("property graph element"), PropgraphElementRelationId, PropgraphElementObjectIndexId, PROPGRAPHELOID, @@ -390,7 +390,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph element label", + gettext_noop("property graph element label"), PropgraphElementLabelRelationId, PropgraphElementLabelObjectIndexId, -1, @@ -404,7 +404,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph label", + gettext_noop("property graph label"), PropgraphLabelRelationId, PropgraphLabelObjectIndexId, PROPGRAPHLABELOID, @@ -418,7 +418,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph label property", + gettext_noop("property graph label property"), PropgraphLabelPropertyRelationId, PropgraphLabelPropertyObjectIndexId, -1, @@ -432,7 +432,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph property", + gettext_noop("property graph property"), PropgraphPropertyRelationId, PropgraphPropertyObjectIndexId, -1, @@ -446,7 +446,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "role", + gettext_noop("role"), AuthIdRelationId, AuthIdOidIndexId, AUTHOID, @@ -460,7 +460,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "role membership", + gettext_noop("role membership"), AuthMemRelationId, AuthMemOidIndexId, SYSCACHEID_INVALID, @@ -474,7 +474,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "rule", + gettext_noop("rule"), RewriteRelationId, RewriteOidIndexId, SYSCACHEID_INVALID, @@ -488,7 +488,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "schema", + gettext_noop("schema"), NamespaceRelationId, NamespaceOidIndexId, NAMESPACEOID, @@ -502,7 +502,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "relation", + gettext_noop("relation"), RelationRelationId, ClassOidIndexId, RELOID, @@ -516,7 +516,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "tablespace", + gettext_noop("tablespace"), TableSpaceRelationId, TablespaceOidIndexId, TABLESPACEOID, @@ -530,7 +530,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "transform", + gettext_noop("transform"), TransformRelationId, TransformOidIndexId, TRFOID, @@ -544,7 +544,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "trigger", + gettext_noop("trigger"), TriggerRelationId, TriggerOidIndexId, SYSCACHEID_INVALID, @@ -558,7 +558,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "policy", + gettext_noop("policy"), PolicyRelationId, PolicyOidIndexId, SYSCACHEID_INVALID, @@ -572,7 +572,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "event trigger", + gettext_noop("event trigger"), EventTriggerRelationId, EventTriggerOidIndexId, EVENTTRIGGEROID, @@ -586,7 +586,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search configuration", + gettext_noop("text search configuration"), TSConfigRelationId, TSConfigOidIndexId, TSCONFIGOID, @@ -600,7 +600,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search dictionary", + gettext_noop("text search dictionary"), TSDictionaryRelationId, TSDictionaryOidIndexId, TSDICTOID, @@ -614,7 +614,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search parser", + gettext_noop("text search parser"), TSParserRelationId, TSParserOidIndexId, TSPARSEROID, @@ -628,7 +628,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search template", + gettext_noop("text search template"), TSTemplateRelationId, TSTemplateOidIndexId, TSTEMPLATEOID, @@ -642,7 +642,7 @@ static const ObjectPropertyType ObjectProperty[] = true, }, { - "type", + gettext_noop("type"), TypeRelationId, TypeOidIndexId, TYPEOID, @@ -656,7 +656,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "publication", + gettext_noop("publication"), PublicationRelationId, PublicationObjectIndexId, PUBLICATIONOID, @@ -670,7 +670,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "subscription", + gettext_noop("subscription"), SubscriptionRelationId, SubscriptionObjectIndexId, SUBSCRIPTIONOID, @@ -684,7 +684,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "extended statistics", + gettext_noop("extended statistics"), StatisticExtRelationId, StatisticExtOidIndexId, STATEXTOID, @@ -698,7 +698,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "user mapping", + gettext_noop("user mapping"), UserMappingRelationId, UserMappingOidIndexId, USERMAPPINGOID, diff --git a/src/backend/catalog/pg_depend.c b/src/backend/catalog/pg_depend.c index 9a7a401aced..0d28d34412d 100644 --- a/src/backend/catalog/pg_depend.c +++ b/src/backend/catalog/pg_depend.c @@ -810,7 +810,7 @@ dependencyLockAndCheckObject(Oid classId, Oid objectId) ereport(ERROR, (errcode(ERRCODE_UNDEFINED_OBJECT), errmsg("referenced %s was concurrently dropped", - get_object_class_descr(classId)))); + _(get_object_class_descr(classId))))); systable_endscan(scan); table_close(rel, AccessShareLock); -- 2.52.0 ----Next_Part(Fri_Jul__3_15_37_42_2026_665)---- ^ permalink raw reply [nested|flat] 34+ messages in thread
* [PATCH v1] Mark object class descriptions for translation @ 2026-07-03 06:06 Kyotaro Horiguchi <[email protected]> 0 siblings, 0 replies; 34+ messages in thread From: Kyotaro Horiguchi @ 2026-07-03 06:06 UTC (permalink / raw) ObjectPropertyType.class_descr was originally intended for internal error messages, but is now also used in a translated error message. Mark the object class descriptions for translation and translate the return value of get_object_class_descr(). --- src/backend/catalog/objectaddress.c | 88 ++++++++++++++--------------- src/backend/catalog/pg_depend.c | 2 +- 2 files changed, 45 insertions(+), 45 deletions(-) diff --git a/src/backend/catalog/objectaddress.c b/src/backend/catalog/objectaddress.c index af0e4703616..12dc76b712a 100644 --- a/src/backend/catalog/objectaddress.c +++ b/src/backend/catalog/objectaddress.c @@ -100,8 +100,8 @@ */ typedef struct { - const char *class_descr; /* string describing the catalog, for internal - * error messages */ + const char *class_descr; /* string describing the catalog, for error + * messages */ Oid class_oid; /* oid of catalog */ Oid oid_index_oid; /* oid of index on system oid column */ SysCacheIdentifier oid_catcache_id; /* id of catcache on system oid column */ @@ -124,7 +124,7 @@ typedef struct static const ObjectPropertyType ObjectProperty[] = { { - "access method", + gettext_noop("access method"), AccessMethodRelationId, AmOidIndexId, AMOID, @@ -138,7 +138,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "access method operator", + gettext_noop("access method operator"), AccessMethodOperatorRelationId, AccessMethodOperatorOidIndexId, SYSCACHEID_INVALID, @@ -152,7 +152,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "access method procedure", + gettext_noop("access method procedure"), AccessMethodProcedureRelationId, AccessMethodProcedureOidIndexId, SYSCACHEID_INVALID, @@ -166,7 +166,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "cast", + gettext_noop("cast"), CastRelationId, CastOidIndexId, SYSCACHEID_INVALID, @@ -180,7 +180,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "collation", + gettext_noop("collation"), CollationRelationId, CollationOidIndexId, COLLOID, @@ -194,7 +194,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "constraint", + gettext_noop("constraint"), ConstraintRelationId, ConstraintOidIndexId, CONSTROID, @@ -208,7 +208,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "conversion", + gettext_noop("conversion"), ConversionRelationId, ConversionOidIndexId, CONVOID, @@ -222,7 +222,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "database", + gettext_noop("database"), DatabaseRelationId, DatabaseOidIndexId, DATABASEOID, @@ -236,7 +236,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "default ACL", + gettext_noop("default ACL"), DefaultAclRelationId, DefaultAclOidIndexId, SYSCACHEID_INVALID, @@ -250,7 +250,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "extension", + gettext_noop("extension"), ExtensionRelationId, ExtensionOidIndexId, SYSCACHEID_INVALID, @@ -264,7 +264,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "foreign-data wrapper", + gettext_noop("foreign-data wrapper"), ForeignDataWrapperRelationId, ForeignDataWrapperOidIndexId, FOREIGNDATAWRAPPEROID, @@ -278,7 +278,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "foreign server", + gettext_noop("foreign server"), ForeignServerRelationId, ForeignServerOidIndexId, FOREIGNSERVEROID, @@ -292,7 +292,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "function", + gettext_noop("function"), ProcedureRelationId, ProcedureOidIndexId, PROCOID, @@ -306,7 +306,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "language", + gettext_noop("language"), LanguageRelationId, LanguageOidIndexId, LANGOID, @@ -320,7 +320,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "large object metadata", + gettext_noop("large object metadata"), LargeObjectMetadataRelationId, LargeObjectMetadataOidIndexId, SYSCACHEID_INVALID, @@ -334,7 +334,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "operator class", + gettext_noop("operator class"), OperatorClassRelationId, OpclassOidIndexId, CLAOID, @@ -348,7 +348,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "operator", + gettext_noop("operator"), OperatorRelationId, OperatorOidIndexId, OPEROID, @@ -362,7 +362,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "operator family", + gettext_noop("operator family"), OperatorFamilyRelationId, OpfamilyOidIndexId, OPFAMILYOID, @@ -376,7 +376,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "property graph element", + gettext_noop("property graph element"), PropgraphElementRelationId, PropgraphElementObjectIndexId, PROPGRAPHELOID, @@ -390,7 +390,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph element label", + gettext_noop("property graph element label"), PropgraphElementLabelRelationId, PropgraphElementLabelObjectIndexId, -1, @@ -404,7 +404,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph label", + gettext_noop("property graph label"), PropgraphLabelRelationId, PropgraphLabelObjectIndexId, PROPGRAPHLABELOID, @@ -418,7 +418,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph label property", + gettext_noop("property graph label property"), PropgraphLabelPropertyRelationId, PropgraphLabelPropertyObjectIndexId, -1, @@ -432,7 +432,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph property", + gettext_noop("property graph property"), PropgraphPropertyRelationId, PropgraphPropertyObjectIndexId, -1, @@ -446,7 +446,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "role", + gettext_noop("role"), AuthIdRelationId, AuthIdOidIndexId, AUTHOID, @@ -460,7 +460,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "role membership", + gettext_noop("role membership"), AuthMemRelationId, AuthMemOidIndexId, SYSCACHEID_INVALID, @@ -474,7 +474,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "rule", + gettext_noop("rule"), RewriteRelationId, RewriteOidIndexId, SYSCACHEID_INVALID, @@ -488,7 +488,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "schema", + gettext_noop("schema"), NamespaceRelationId, NamespaceOidIndexId, NAMESPACEOID, @@ -502,7 +502,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "relation", + gettext_noop("relation"), RelationRelationId, ClassOidIndexId, RELOID, @@ -516,7 +516,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "tablespace", + gettext_noop("tablespace"), TableSpaceRelationId, TablespaceOidIndexId, TABLESPACEOID, @@ -530,7 +530,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "transform", + gettext_noop("transform"), TransformRelationId, TransformOidIndexId, TRFOID, @@ -544,7 +544,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "trigger", + gettext_noop("trigger"), TriggerRelationId, TriggerOidIndexId, SYSCACHEID_INVALID, @@ -558,7 +558,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "policy", + gettext_noop("policy"), PolicyRelationId, PolicyOidIndexId, SYSCACHEID_INVALID, @@ -572,7 +572,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "event trigger", + gettext_noop("event trigger"), EventTriggerRelationId, EventTriggerOidIndexId, EVENTTRIGGEROID, @@ -586,7 +586,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search configuration", + gettext_noop("text search configuration"), TSConfigRelationId, TSConfigOidIndexId, TSCONFIGOID, @@ -600,7 +600,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search dictionary", + gettext_noop("text search dictionary"), TSDictionaryRelationId, TSDictionaryOidIndexId, TSDICTOID, @@ -614,7 +614,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search parser", + gettext_noop("text search parser"), TSParserRelationId, TSParserOidIndexId, TSPARSEROID, @@ -628,7 +628,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search template", + gettext_noop("text search template"), TSTemplateRelationId, TSTemplateOidIndexId, TSTEMPLATEOID, @@ -642,7 +642,7 @@ static const ObjectPropertyType ObjectProperty[] = true, }, { - "type", + gettext_noop("type"), TypeRelationId, TypeOidIndexId, TYPEOID, @@ -656,7 +656,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "publication", + gettext_noop("publication"), PublicationRelationId, PublicationObjectIndexId, PUBLICATIONOID, @@ -670,7 +670,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "subscription", + gettext_noop("subscription"), SubscriptionRelationId, SubscriptionObjectIndexId, SUBSCRIPTIONOID, @@ -684,7 +684,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "extended statistics", + gettext_noop("extended statistics"), StatisticExtRelationId, StatisticExtOidIndexId, STATEXTOID, @@ -698,7 +698,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "user mapping", + gettext_noop("user mapping"), UserMappingRelationId, UserMappingOidIndexId, USERMAPPINGOID, diff --git a/src/backend/catalog/pg_depend.c b/src/backend/catalog/pg_depend.c index 9a7a401aced..0d28d34412d 100644 --- a/src/backend/catalog/pg_depend.c +++ b/src/backend/catalog/pg_depend.c @@ -810,7 +810,7 @@ dependencyLockAndCheckObject(Oid classId, Oid objectId) ereport(ERROR, (errcode(ERRCODE_UNDEFINED_OBJECT), errmsg("referenced %s was concurrently dropped", - get_object_class_descr(classId)))); + _(get_object_class_descr(classId))))); systable_endscan(scan); table_close(rel, AccessShareLock); -- 2.52.0 ----Next_Part(Fri_Jul__3_15_37_42_2026_665)---- ^ permalink raw reply [nested|flat] 34+ messages in thread
* [PATCH v1] Mark object class descriptions for translation @ 2026-07-03 06:06 Kyotaro Horiguchi <[email protected]> 0 siblings, 0 replies; 34+ messages in thread From: Kyotaro Horiguchi @ 2026-07-03 06:06 UTC (permalink / raw) ObjectPropertyType.class_descr was originally intended for internal error messages, but is now also used in a translated error message. Mark the object class descriptions for translation and translate the return value of get_object_class_descr(). --- src/backend/catalog/objectaddress.c | 88 ++++++++++++++--------------- src/backend/catalog/pg_depend.c | 2 +- 2 files changed, 45 insertions(+), 45 deletions(-) diff --git a/src/backend/catalog/objectaddress.c b/src/backend/catalog/objectaddress.c index af0e4703616..12dc76b712a 100644 --- a/src/backend/catalog/objectaddress.c +++ b/src/backend/catalog/objectaddress.c @@ -100,8 +100,8 @@ */ typedef struct { - const char *class_descr; /* string describing the catalog, for internal - * error messages */ + const char *class_descr; /* string describing the catalog, for error + * messages */ Oid class_oid; /* oid of catalog */ Oid oid_index_oid; /* oid of index on system oid column */ SysCacheIdentifier oid_catcache_id; /* id of catcache on system oid column */ @@ -124,7 +124,7 @@ typedef struct static const ObjectPropertyType ObjectProperty[] = { { - "access method", + gettext_noop("access method"), AccessMethodRelationId, AmOidIndexId, AMOID, @@ -138,7 +138,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "access method operator", + gettext_noop("access method operator"), AccessMethodOperatorRelationId, AccessMethodOperatorOidIndexId, SYSCACHEID_INVALID, @@ -152,7 +152,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "access method procedure", + gettext_noop("access method procedure"), AccessMethodProcedureRelationId, AccessMethodProcedureOidIndexId, SYSCACHEID_INVALID, @@ -166,7 +166,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "cast", + gettext_noop("cast"), CastRelationId, CastOidIndexId, SYSCACHEID_INVALID, @@ -180,7 +180,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "collation", + gettext_noop("collation"), CollationRelationId, CollationOidIndexId, COLLOID, @@ -194,7 +194,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "constraint", + gettext_noop("constraint"), ConstraintRelationId, ConstraintOidIndexId, CONSTROID, @@ -208,7 +208,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "conversion", + gettext_noop("conversion"), ConversionRelationId, ConversionOidIndexId, CONVOID, @@ -222,7 +222,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "database", + gettext_noop("database"), DatabaseRelationId, DatabaseOidIndexId, DATABASEOID, @@ -236,7 +236,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "default ACL", + gettext_noop("default ACL"), DefaultAclRelationId, DefaultAclOidIndexId, SYSCACHEID_INVALID, @@ -250,7 +250,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "extension", + gettext_noop("extension"), ExtensionRelationId, ExtensionOidIndexId, SYSCACHEID_INVALID, @@ -264,7 +264,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "foreign-data wrapper", + gettext_noop("foreign-data wrapper"), ForeignDataWrapperRelationId, ForeignDataWrapperOidIndexId, FOREIGNDATAWRAPPEROID, @@ -278,7 +278,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "foreign server", + gettext_noop("foreign server"), ForeignServerRelationId, ForeignServerOidIndexId, FOREIGNSERVEROID, @@ -292,7 +292,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "function", + gettext_noop("function"), ProcedureRelationId, ProcedureOidIndexId, PROCOID, @@ -306,7 +306,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "language", + gettext_noop("language"), LanguageRelationId, LanguageOidIndexId, LANGOID, @@ -320,7 +320,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "large object metadata", + gettext_noop("large object metadata"), LargeObjectMetadataRelationId, LargeObjectMetadataOidIndexId, SYSCACHEID_INVALID, @@ -334,7 +334,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "operator class", + gettext_noop("operator class"), OperatorClassRelationId, OpclassOidIndexId, CLAOID, @@ -348,7 +348,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "operator", + gettext_noop("operator"), OperatorRelationId, OperatorOidIndexId, OPEROID, @@ -362,7 +362,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "operator family", + gettext_noop("operator family"), OperatorFamilyRelationId, OpfamilyOidIndexId, OPFAMILYOID, @@ -376,7 +376,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "property graph element", + gettext_noop("property graph element"), PropgraphElementRelationId, PropgraphElementObjectIndexId, PROPGRAPHELOID, @@ -390,7 +390,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph element label", + gettext_noop("property graph element label"), PropgraphElementLabelRelationId, PropgraphElementLabelObjectIndexId, -1, @@ -404,7 +404,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph label", + gettext_noop("property graph label"), PropgraphLabelRelationId, PropgraphLabelObjectIndexId, PROPGRAPHLABELOID, @@ -418,7 +418,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph label property", + gettext_noop("property graph label property"), PropgraphLabelPropertyRelationId, PropgraphLabelPropertyObjectIndexId, -1, @@ -432,7 +432,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph property", + gettext_noop("property graph property"), PropgraphPropertyRelationId, PropgraphPropertyObjectIndexId, -1, @@ -446,7 +446,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "role", + gettext_noop("role"), AuthIdRelationId, AuthIdOidIndexId, AUTHOID, @@ -460,7 +460,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "role membership", + gettext_noop("role membership"), AuthMemRelationId, AuthMemOidIndexId, SYSCACHEID_INVALID, @@ -474,7 +474,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "rule", + gettext_noop("rule"), RewriteRelationId, RewriteOidIndexId, SYSCACHEID_INVALID, @@ -488,7 +488,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "schema", + gettext_noop("schema"), NamespaceRelationId, NamespaceOidIndexId, NAMESPACEOID, @@ -502,7 +502,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "relation", + gettext_noop("relation"), RelationRelationId, ClassOidIndexId, RELOID, @@ -516,7 +516,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "tablespace", + gettext_noop("tablespace"), TableSpaceRelationId, TablespaceOidIndexId, TABLESPACEOID, @@ -530,7 +530,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "transform", + gettext_noop("transform"), TransformRelationId, TransformOidIndexId, TRFOID, @@ -544,7 +544,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "trigger", + gettext_noop("trigger"), TriggerRelationId, TriggerOidIndexId, SYSCACHEID_INVALID, @@ -558,7 +558,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "policy", + gettext_noop("policy"), PolicyRelationId, PolicyOidIndexId, SYSCACHEID_INVALID, @@ -572,7 +572,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "event trigger", + gettext_noop("event trigger"), EventTriggerRelationId, EventTriggerOidIndexId, EVENTTRIGGEROID, @@ -586,7 +586,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search configuration", + gettext_noop("text search configuration"), TSConfigRelationId, TSConfigOidIndexId, TSCONFIGOID, @@ -600,7 +600,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search dictionary", + gettext_noop("text search dictionary"), TSDictionaryRelationId, TSDictionaryOidIndexId, TSDICTOID, @@ -614,7 +614,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search parser", + gettext_noop("text search parser"), TSParserRelationId, TSParserOidIndexId, TSPARSEROID, @@ -628,7 +628,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search template", + gettext_noop("text search template"), TSTemplateRelationId, TSTemplateOidIndexId, TSTEMPLATEOID, @@ -642,7 +642,7 @@ static const ObjectPropertyType ObjectProperty[] = true, }, { - "type", + gettext_noop("type"), TypeRelationId, TypeOidIndexId, TYPEOID, @@ -656,7 +656,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "publication", + gettext_noop("publication"), PublicationRelationId, PublicationObjectIndexId, PUBLICATIONOID, @@ -670,7 +670,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "subscription", + gettext_noop("subscription"), SubscriptionRelationId, SubscriptionObjectIndexId, SUBSCRIPTIONOID, @@ -684,7 +684,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "extended statistics", + gettext_noop("extended statistics"), StatisticExtRelationId, StatisticExtOidIndexId, STATEXTOID, @@ -698,7 +698,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "user mapping", + gettext_noop("user mapping"), UserMappingRelationId, UserMappingOidIndexId, USERMAPPINGOID, diff --git a/src/backend/catalog/pg_depend.c b/src/backend/catalog/pg_depend.c index 9a7a401aced..0d28d34412d 100644 --- a/src/backend/catalog/pg_depend.c +++ b/src/backend/catalog/pg_depend.c @@ -810,7 +810,7 @@ dependencyLockAndCheckObject(Oid classId, Oid objectId) ereport(ERROR, (errcode(ERRCODE_UNDEFINED_OBJECT), errmsg("referenced %s was concurrently dropped", - get_object_class_descr(classId)))); + _(get_object_class_descr(classId))))); systable_endscan(scan); table_close(rel, AccessShareLock); -- 2.52.0 ----Next_Part(Fri_Jul__3_15_37_42_2026_665)---- ^ permalink raw reply [nested|flat] 34+ messages in thread
* [PATCH v1] Mark object class descriptions for translation @ 2026-07-03 06:06 Kyotaro Horiguchi <[email protected]> 0 siblings, 0 replies; 34+ messages in thread From: Kyotaro Horiguchi @ 2026-07-03 06:06 UTC (permalink / raw) ObjectPropertyType.class_descr was originally intended for internal error messages, but is now also used in a translated error message. Mark the object class descriptions for translation and translate the return value of get_object_class_descr(). --- src/backend/catalog/objectaddress.c | 88 ++++++++++++++--------------- src/backend/catalog/pg_depend.c | 2 +- 2 files changed, 45 insertions(+), 45 deletions(-) diff --git a/src/backend/catalog/objectaddress.c b/src/backend/catalog/objectaddress.c index af0e4703616..12dc76b712a 100644 --- a/src/backend/catalog/objectaddress.c +++ b/src/backend/catalog/objectaddress.c @@ -100,8 +100,8 @@ */ typedef struct { - const char *class_descr; /* string describing the catalog, for internal - * error messages */ + const char *class_descr; /* string describing the catalog, for error + * messages */ Oid class_oid; /* oid of catalog */ Oid oid_index_oid; /* oid of index on system oid column */ SysCacheIdentifier oid_catcache_id; /* id of catcache on system oid column */ @@ -124,7 +124,7 @@ typedef struct static const ObjectPropertyType ObjectProperty[] = { { - "access method", + gettext_noop("access method"), AccessMethodRelationId, AmOidIndexId, AMOID, @@ -138,7 +138,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "access method operator", + gettext_noop("access method operator"), AccessMethodOperatorRelationId, AccessMethodOperatorOidIndexId, SYSCACHEID_INVALID, @@ -152,7 +152,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "access method procedure", + gettext_noop("access method procedure"), AccessMethodProcedureRelationId, AccessMethodProcedureOidIndexId, SYSCACHEID_INVALID, @@ -166,7 +166,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "cast", + gettext_noop("cast"), CastRelationId, CastOidIndexId, SYSCACHEID_INVALID, @@ -180,7 +180,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "collation", + gettext_noop("collation"), CollationRelationId, CollationOidIndexId, COLLOID, @@ -194,7 +194,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "constraint", + gettext_noop("constraint"), ConstraintRelationId, ConstraintOidIndexId, CONSTROID, @@ -208,7 +208,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "conversion", + gettext_noop("conversion"), ConversionRelationId, ConversionOidIndexId, CONVOID, @@ -222,7 +222,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "database", + gettext_noop("database"), DatabaseRelationId, DatabaseOidIndexId, DATABASEOID, @@ -236,7 +236,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "default ACL", + gettext_noop("default ACL"), DefaultAclRelationId, DefaultAclOidIndexId, SYSCACHEID_INVALID, @@ -250,7 +250,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "extension", + gettext_noop("extension"), ExtensionRelationId, ExtensionOidIndexId, SYSCACHEID_INVALID, @@ -264,7 +264,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "foreign-data wrapper", + gettext_noop("foreign-data wrapper"), ForeignDataWrapperRelationId, ForeignDataWrapperOidIndexId, FOREIGNDATAWRAPPEROID, @@ -278,7 +278,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "foreign server", + gettext_noop("foreign server"), ForeignServerRelationId, ForeignServerOidIndexId, FOREIGNSERVEROID, @@ -292,7 +292,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "function", + gettext_noop("function"), ProcedureRelationId, ProcedureOidIndexId, PROCOID, @@ -306,7 +306,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "language", + gettext_noop("language"), LanguageRelationId, LanguageOidIndexId, LANGOID, @@ -320,7 +320,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "large object metadata", + gettext_noop("large object metadata"), LargeObjectMetadataRelationId, LargeObjectMetadataOidIndexId, SYSCACHEID_INVALID, @@ -334,7 +334,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "operator class", + gettext_noop("operator class"), OperatorClassRelationId, OpclassOidIndexId, CLAOID, @@ -348,7 +348,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "operator", + gettext_noop("operator"), OperatorRelationId, OperatorOidIndexId, OPEROID, @@ -362,7 +362,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "operator family", + gettext_noop("operator family"), OperatorFamilyRelationId, OpfamilyOidIndexId, OPFAMILYOID, @@ -376,7 +376,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "property graph element", + gettext_noop("property graph element"), PropgraphElementRelationId, PropgraphElementObjectIndexId, PROPGRAPHELOID, @@ -390,7 +390,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph element label", + gettext_noop("property graph element label"), PropgraphElementLabelRelationId, PropgraphElementLabelObjectIndexId, -1, @@ -404,7 +404,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph label", + gettext_noop("property graph label"), PropgraphLabelRelationId, PropgraphLabelObjectIndexId, PROPGRAPHLABELOID, @@ -418,7 +418,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph label property", + gettext_noop("property graph label property"), PropgraphLabelPropertyRelationId, PropgraphLabelPropertyObjectIndexId, -1, @@ -432,7 +432,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph property", + gettext_noop("property graph property"), PropgraphPropertyRelationId, PropgraphPropertyObjectIndexId, -1, @@ -446,7 +446,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "role", + gettext_noop("role"), AuthIdRelationId, AuthIdOidIndexId, AUTHOID, @@ -460,7 +460,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "role membership", + gettext_noop("role membership"), AuthMemRelationId, AuthMemOidIndexId, SYSCACHEID_INVALID, @@ -474,7 +474,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "rule", + gettext_noop("rule"), RewriteRelationId, RewriteOidIndexId, SYSCACHEID_INVALID, @@ -488,7 +488,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "schema", + gettext_noop("schema"), NamespaceRelationId, NamespaceOidIndexId, NAMESPACEOID, @@ -502,7 +502,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "relation", + gettext_noop("relation"), RelationRelationId, ClassOidIndexId, RELOID, @@ -516,7 +516,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "tablespace", + gettext_noop("tablespace"), TableSpaceRelationId, TablespaceOidIndexId, TABLESPACEOID, @@ -530,7 +530,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "transform", + gettext_noop("transform"), TransformRelationId, TransformOidIndexId, TRFOID, @@ -544,7 +544,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "trigger", + gettext_noop("trigger"), TriggerRelationId, TriggerOidIndexId, SYSCACHEID_INVALID, @@ -558,7 +558,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "policy", + gettext_noop("policy"), PolicyRelationId, PolicyOidIndexId, SYSCACHEID_INVALID, @@ -572,7 +572,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "event trigger", + gettext_noop("event trigger"), EventTriggerRelationId, EventTriggerOidIndexId, EVENTTRIGGEROID, @@ -586,7 +586,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search configuration", + gettext_noop("text search configuration"), TSConfigRelationId, TSConfigOidIndexId, TSCONFIGOID, @@ -600,7 +600,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search dictionary", + gettext_noop("text search dictionary"), TSDictionaryRelationId, TSDictionaryOidIndexId, TSDICTOID, @@ -614,7 +614,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search parser", + gettext_noop("text search parser"), TSParserRelationId, TSParserOidIndexId, TSPARSEROID, @@ -628,7 +628,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search template", + gettext_noop("text search template"), TSTemplateRelationId, TSTemplateOidIndexId, TSTEMPLATEOID, @@ -642,7 +642,7 @@ static const ObjectPropertyType ObjectProperty[] = true, }, { - "type", + gettext_noop("type"), TypeRelationId, TypeOidIndexId, TYPEOID, @@ -656,7 +656,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "publication", + gettext_noop("publication"), PublicationRelationId, PublicationObjectIndexId, PUBLICATIONOID, @@ -670,7 +670,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "subscription", + gettext_noop("subscription"), SubscriptionRelationId, SubscriptionObjectIndexId, SUBSCRIPTIONOID, @@ -684,7 +684,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "extended statistics", + gettext_noop("extended statistics"), StatisticExtRelationId, StatisticExtOidIndexId, STATEXTOID, @@ -698,7 +698,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "user mapping", + gettext_noop("user mapping"), UserMappingRelationId, UserMappingOidIndexId, USERMAPPINGOID, diff --git a/src/backend/catalog/pg_depend.c b/src/backend/catalog/pg_depend.c index 9a7a401aced..0d28d34412d 100644 --- a/src/backend/catalog/pg_depend.c +++ b/src/backend/catalog/pg_depend.c @@ -810,7 +810,7 @@ dependencyLockAndCheckObject(Oid classId, Oid objectId) ereport(ERROR, (errcode(ERRCODE_UNDEFINED_OBJECT), errmsg("referenced %s was concurrently dropped", - get_object_class_descr(classId)))); + _(get_object_class_descr(classId))))); systable_endscan(scan); table_close(rel, AccessShareLock); -- 2.52.0 ----Next_Part(Fri_Jul__3_15_37_42_2026_665)---- ^ permalink raw reply [nested|flat] 34+ messages in thread
* [PATCH v1] Mark object class descriptions for translation @ 2026-07-03 06:06 Kyotaro Horiguchi <[email protected]> 0 siblings, 0 replies; 34+ messages in thread From: Kyotaro Horiguchi @ 2026-07-03 06:06 UTC (permalink / raw) ObjectPropertyType.class_descr was originally intended for internal error messages, but is now also used in a translated error message. Mark the object class descriptions for translation and translate the return value of get_object_class_descr(). --- src/backend/catalog/objectaddress.c | 88 ++++++++++++++--------------- src/backend/catalog/pg_depend.c | 2 +- 2 files changed, 45 insertions(+), 45 deletions(-) diff --git a/src/backend/catalog/objectaddress.c b/src/backend/catalog/objectaddress.c index af0e4703616..12dc76b712a 100644 --- a/src/backend/catalog/objectaddress.c +++ b/src/backend/catalog/objectaddress.c @@ -100,8 +100,8 @@ */ typedef struct { - const char *class_descr; /* string describing the catalog, for internal - * error messages */ + const char *class_descr; /* string describing the catalog, for error + * messages */ Oid class_oid; /* oid of catalog */ Oid oid_index_oid; /* oid of index on system oid column */ SysCacheIdentifier oid_catcache_id; /* id of catcache on system oid column */ @@ -124,7 +124,7 @@ typedef struct static const ObjectPropertyType ObjectProperty[] = { { - "access method", + gettext_noop("access method"), AccessMethodRelationId, AmOidIndexId, AMOID, @@ -138,7 +138,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "access method operator", + gettext_noop("access method operator"), AccessMethodOperatorRelationId, AccessMethodOperatorOidIndexId, SYSCACHEID_INVALID, @@ -152,7 +152,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "access method procedure", + gettext_noop("access method procedure"), AccessMethodProcedureRelationId, AccessMethodProcedureOidIndexId, SYSCACHEID_INVALID, @@ -166,7 +166,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "cast", + gettext_noop("cast"), CastRelationId, CastOidIndexId, SYSCACHEID_INVALID, @@ -180,7 +180,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "collation", + gettext_noop("collation"), CollationRelationId, CollationOidIndexId, COLLOID, @@ -194,7 +194,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "constraint", + gettext_noop("constraint"), ConstraintRelationId, ConstraintOidIndexId, CONSTROID, @@ -208,7 +208,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "conversion", + gettext_noop("conversion"), ConversionRelationId, ConversionOidIndexId, CONVOID, @@ -222,7 +222,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "database", + gettext_noop("database"), DatabaseRelationId, DatabaseOidIndexId, DATABASEOID, @@ -236,7 +236,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "default ACL", + gettext_noop("default ACL"), DefaultAclRelationId, DefaultAclOidIndexId, SYSCACHEID_INVALID, @@ -250,7 +250,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "extension", + gettext_noop("extension"), ExtensionRelationId, ExtensionOidIndexId, SYSCACHEID_INVALID, @@ -264,7 +264,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "foreign-data wrapper", + gettext_noop("foreign-data wrapper"), ForeignDataWrapperRelationId, ForeignDataWrapperOidIndexId, FOREIGNDATAWRAPPEROID, @@ -278,7 +278,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "foreign server", + gettext_noop("foreign server"), ForeignServerRelationId, ForeignServerOidIndexId, FOREIGNSERVEROID, @@ -292,7 +292,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "function", + gettext_noop("function"), ProcedureRelationId, ProcedureOidIndexId, PROCOID, @@ -306,7 +306,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "language", + gettext_noop("language"), LanguageRelationId, LanguageOidIndexId, LANGOID, @@ -320,7 +320,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "large object metadata", + gettext_noop("large object metadata"), LargeObjectMetadataRelationId, LargeObjectMetadataOidIndexId, SYSCACHEID_INVALID, @@ -334,7 +334,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "operator class", + gettext_noop("operator class"), OperatorClassRelationId, OpclassOidIndexId, CLAOID, @@ -348,7 +348,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "operator", + gettext_noop("operator"), OperatorRelationId, OperatorOidIndexId, OPEROID, @@ -362,7 +362,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "operator family", + gettext_noop("operator family"), OperatorFamilyRelationId, OpfamilyOidIndexId, OPFAMILYOID, @@ -376,7 +376,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "property graph element", + gettext_noop("property graph element"), PropgraphElementRelationId, PropgraphElementObjectIndexId, PROPGRAPHELOID, @@ -390,7 +390,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph element label", + gettext_noop("property graph element label"), PropgraphElementLabelRelationId, PropgraphElementLabelObjectIndexId, -1, @@ -404,7 +404,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph label", + gettext_noop("property graph label"), PropgraphLabelRelationId, PropgraphLabelObjectIndexId, PROPGRAPHLABELOID, @@ -418,7 +418,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph label property", + gettext_noop("property graph label property"), PropgraphLabelPropertyRelationId, PropgraphLabelPropertyObjectIndexId, -1, @@ -432,7 +432,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph property", + gettext_noop("property graph property"), PropgraphPropertyRelationId, PropgraphPropertyObjectIndexId, -1, @@ -446,7 +446,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "role", + gettext_noop("role"), AuthIdRelationId, AuthIdOidIndexId, AUTHOID, @@ -460,7 +460,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "role membership", + gettext_noop("role membership"), AuthMemRelationId, AuthMemOidIndexId, SYSCACHEID_INVALID, @@ -474,7 +474,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "rule", + gettext_noop("rule"), RewriteRelationId, RewriteOidIndexId, SYSCACHEID_INVALID, @@ -488,7 +488,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "schema", + gettext_noop("schema"), NamespaceRelationId, NamespaceOidIndexId, NAMESPACEOID, @@ -502,7 +502,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "relation", + gettext_noop("relation"), RelationRelationId, ClassOidIndexId, RELOID, @@ -516,7 +516,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "tablespace", + gettext_noop("tablespace"), TableSpaceRelationId, TablespaceOidIndexId, TABLESPACEOID, @@ -530,7 +530,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "transform", + gettext_noop("transform"), TransformRelationId, TransformOidIndexId, TRFOID, @@ -544,7 +544,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "trigger", + gettext_noop("trigger"), TriggerRelationId, TriggerOidIndexId, SYSCACHEID_INVALID, @@ -558,7 +558,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "policy", + gettext_noop("policy"), PolicyRelationId, PolicyOidIndexId, SYSCACHEID_INVALID, @@ -572,7 +572,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "event trigger", + gettext_noop("event trigger"), EventTriggerRelationId, EventTriggerOidIndexId, EVENTTRIGGEROID, @@ -586,7 +586,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search configuration", + gettext_noop("text search configuration"), TSConfigRelationId, TSConfigOidIndexId, TSCONFIGOID, @@ -600,7 +600,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search dictionary", + gettext_noop("text search dictionary"), TSDictionaryRelationId, TSDictionaryOidIndexId, TSDICTOID, @@ -614,7 +614,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search parser", + gettext_noop("text search parser"), TSParserRelationId, TSParserOidIndexId, TSPARSEROID, @@ -628,7 +628,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search template", + gettext_noop("text search template"), TSTemplateRelationId, TSTemplateOidIndexId, TSTEMPLATEOID, @@ -642,7 +642,7 @@ static const ObjectPropertyType ObjectProperty[] = true, }, { - "type", + gettext_noop("type"), TypeRelationId, TypeOidIndexId, TYPEOID, @@ -656,7 +656,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "publication", + gettext_noop("publication"), PublicationRelationId, PublicationObjectIndexId, PUBLICATIONOID, @@ -670,7 +670,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "subscription", + gettext_noop("subscription"), SubscriptionRelationId, SubscriptionObjectIndexId, SUBSCRIPTIONOID, @@ -684,7 +684,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "extended statistics", + gettext_noop("extended statistics"), StatisticExtRelationId, StatisticExtOidIndexId, STATEXTOID, @@ -698,7 +698,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "user mapping", + gettext_noop("user mapping"), UserMappingRelationId, UserMappingOidIndexId, USERMAPPINGOID, diff --git a/src/backend/catalog/pg_depend.c b/src/backend/catalog/pg_depend.c index 9a7a401aced..0d28d34412d 100644 --- a/src/backend/catalog/pg_depend.c +++ b/src/backend/catalog/pg_depend.c @@ -810,7 +810,7 @@ dependencyLockAndCheckObject(Oid classId, Oid objectId) ereport(ERROR, (errcode(ERRCODE_UNDEFINED_OBJECT), errmsg("referenced %s was concurrently dropped", - get_object_class_descr(classId)))); + _(get_object_class_descr(classId))))); systable_endscan(scan); table_close(rel, AccessShareLock); -- 2.52.0 ----Next_Part(Fri_Jul__3_15_37_42_2026_665)---- ^ permalink raw reply [nested|flat] 34+ messages in thread
* [PATCH v1] Mark object class descriptions for translation @ 2026-07-03 06:06 Kyotaro Horiguchi <[email protected]> 0 siblings, 0 replies; 34+ messages in thread From: Kyotaro Horiguchi @ 2026-07-03 06:06 UTC (permalink / raw) ObjectPropertyType.class_descr was originally intended for internal error messages, but is now also used in a translated error message. Mark the object class descriptions for translation and translate the return value of get_object_class_descr(). --- src/backend/catalog/objectaddress.c | 88 ++++++++++++++--------------- src/backend/catalog/pg_depend.c | 2 +- 2 files changed, 45 insertions(+), 45 deletions(-) diff --git a/src/backend/catalog/objectaddress.c b/src/backend/catalog/objectaddress.c index af0e4703616..12dc76b712a 100644 --- a/src/backend/catalog/objectaddress.c +++ b/src/backend/catalog/objectaddress.c @@ -100,8 +100,8 @@ */ typedef struct { - const char *class_descr; /* string describing the catalog, for internal - * error messages */ + const char *class_descr; /* string describing the catalog, for error + * messages */ Oid class_oid; /* oid of catalog */ Oid oid_index_oid; /* oid of index on system oid column */ SysCacheIdentifier oid_catcache_id; /* id of catcache on system oid column */ @@ -124,7 +124,7 @@ typedef struct static const ObjectPropertyType ObjectProperty[] = { { - "access method", + gettext_noop("access method"), AccessMethodRelationId, AmOidIndexId, AMOID, @@ -138,7 +138,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "access method operator", + gettext_noop("access method operator"), AccessMethodOperatorRelationId, AccessMethodOperatorOidIndexId, SYSCACHEID_INVALID, @@ -152,7 +152,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "access method procedure", + gettext_noop("access method procedure"), AccessMethodProcedureRelationId, AccessMethodProcedureOidIndexId, SYSCACHEID_INVALID, @@ -166,7 +166,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "cast", + gettext_noop("cast"), CastRelationId, CastOidIndexId, SYSCACHEID_INVALID, @@ -180,7 +180,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "collation", + gettext_noop("collation"), CollationRelationId, CollationOidIndexId, COLLOID, @@ -194,7 +194,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "constraint", + gettext_noop("constraint"), ConstraintRelationId, ConstraintOidIndexId, CONSTROID, @@ -208,7 +208,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "conversion", + gettext_noop("conversion"), ConversionRelationId, ConversionOidIndexId, CONVOID, @@ -222,7 +222,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "database", + gettext_noop("database"), DatabaseRelationId, DatabaseOidIndexId, DATABASEOID, @@ -236,7 +236,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "default ACL", + gettext_noop("default ACL"), DefaultAclRelationId, DefaultAclOidIndexId, SYSCACHEID_INVALID, @@ -250,7 +250,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "extension", + gettext_noop("extension"), ExtensionRelationId, ExtensionOidIndexId, SYSCACHEID_INVALID, @@ -264,7 +264,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "foreign-data wrapper", + gettext_noop("foreign-data wrapper"), ForeignDataWrapperRelationId, ForeignDataWrapperOidIndexId, FOREIGNDATAWRAPPEROID, @@ -278,7 +278,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "foreign server", + gettext_noop("foreign server"), ForeignServerRelationId, ForeignServerOidIndexId, FOREIGNSERVEROID, @@ -292,7 +292,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "function", + gettext_noop("function"), ProcedureRelationId, ProcedureOidIndexId, PROCOID, @@ -306,7 +306,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "language", + gettext_noop("language"), LanguageRelationId, LanguageOidIndexId, LANGOID, @@ -320,7 +320,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "large object metadata", + gettext_noop("large object metadata"), LargeObjectMetadataRelationId, LargeObjectMetadataOidIndexId, SYSCACHEID_INVALID, @@ -334,7 +334,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "operator class", + gettext_noop("operator class"), OperatorClassRelationId, OpclassOidIndexId, CLAOID, @@ -348,7 +348,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "operator", + gettext_noop("operator"), OperatorRelationId, OperatorOidIndexId, OPEROID, @@ -362,7 +362,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "operator family", + gettext_noop("operator family"), OperatorFamilyRelationId, OpfamilyOidIndexId, OPFAMILYOID, @@ -376,7 +376,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "property graph element", + gettext_noop("property graph element"), PropgraphElementRelationId, PropgraphElementObjectIndexId, PROPGRAPHELOID, @@ -390,7 +390,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph element label", + gettext_noop("property graph element label"), PropgraphElementLabelRelationId, PropgraphElementLabelObjectIndexId, -1, @@ -404,7 +404,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph label", + gettext_noop("property graph label"), PropgraphLabelRelationId, PropgraphLabelObjectIndexId, PROPGRAPHLABELOID, @@ -418,7 +418,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph label property", + gettext_noop("property graph label property"), PropgraphLabelPropertyRelationId, PropgraphLabelPropertyObjectIndexId, -1, @@ -432,7 +432,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph property", + gettext_noop("property graph property"), PropgraphPropertyRelationId, PropgraphPropertyObjectIndexId, -1, @@ -446,7 +446,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "role", + gettext_noop("role"), AuthIdRelationId, AuthIdOidIndexId, AUTHOID, @@ -460,7 +460,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "role membership", + gettext_noop("role membership"), AuthMemRelationId, AuthMemOidIndexId, SYSCACHEID_INVALID, @@ -474,7 +474,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "rule", + gettext_noop("rule"), RewriteRelationId, RewriteOidIndexId, SYSCACHEID_INVALID, @@ -488,7 +488,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "schema", + gettext_noop("schema"), NamespaceRelationId, NamespaceOidIndexId, NAMESPACEOID, @@ -502,7 +502,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "relation", + gettext_noop("relation"), RelationRelationId, ClassOidIndexId, RELOID, @@ -516,7 +516,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "tablespace", + gettext_noop("tablespace"), TableSpaceRelationId, TablespaceOidIndexId, TABLESPACEOID, @@ -530,7 +530,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "transform", + gettext_noop("transform"), TransformRelationId, TransformOidIndexId, TRFOID, @@ -544,7 +544,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "trigger", + gettext_noop("trigger"), TriggerRelationId, TriggerOidIndexId, SYSCACHEID_INVALID, @@ -558,7 +558,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "policy", + gettext_noop("policy"), PolicyRelationId, PolicyOidIndexId, SYSCACHEID_INVALID, @@ -572,7 +572,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "event trigger", + gettext_noop("event trigger"), EventTriggerRelationId, EventTriggerOidIndexId, EVENTTRIGGEROID, @@ -586,7 +586,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search configuration", + gettext_noop("text search configuration"), TSConfigRelationId, TSConfigOidIndexId, TSCONFIGOID, @@ -600,7 +600,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search dictionary", + gettext_noop("text search dictionary"), TSDictionaryRelationId, TSDictionaryOidIndexId, TSDICTOID, @@ -614,7 +614,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search parser", + gettext_noop("text search parser"), TSParserRelationId, TSParserOidIndexId, TSPARSEROID, @@ -628,7 +628,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search template", + gettext_noop("text search template"), TSTemplateRelationId, TSTemplateOidIndexId, TSTEMPLATEOID, @@ -642,7 +642,7 @@ static const ObjectPropertyType ObjectProperty[] = true, }, { - "type", + gettext_noop("type"), TypeRelationId, TypeOidIndexId, TYPEOID, @@ -656,7 +656,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "publication", + gettext_noop("publication"), PublicationRelationId, PublicationObjectIndexId, PUBLICATIONOID, @@ -670,7 +670,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "subscription", + gettext_noop("subscription"), SubscriptionRelationId, SubscriptionObjectIndexId, SUBSCRIPTIONOID, @@ -684,7 +684,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "extended statistics", + gettext_noop("extended statistics"), StatisticExtRelationId, StatisticExtOidIndexId, STATEXTOID, @@ -698,7 +698,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "user mapping", + gettext_noop("user mapping"), UserMappingRelationId, UserMappingOidIndexId, USERMAPPINGOID, diff --git a/src/backend/catalog/pg_depend.c b/src/backend/catalog/pg_depend.c index 9a7a401aced..0d28d34412d 100644 --- a/src/backend/catalog/pg_depend.c +++ b/src/backend/catalog/pg_depend.c @@ -810,7 +810,7 @@ dependencyLockAndCheckObject(Oid classId, Oid objectId) ereport(ERROR, (errcode(ERRCODE_UNDEFINED_OBJECT), errmsg("referenced %s was concurrently dropped", - get_object_class_descr(classId)))); + _(get_object_class_descr(classId))))); systable_endscan(scan); table_close(rel, AccessShareLock); -- 2.52.0 ----Next_Part(Fri_Jul__3_15_37_42_2026_665)---- ^ permalink raw reply [nested|flat] 34+ messages in thread
* [PATCH v1] Mark object class descriptions for translation @ 2026-07-03 06:06 Kyotaro Horiguchi <[email protected]> 0 siblings, 0 replies; 34+ messages in thread From: Kyotaro Horiguchi @ 2026-07-03 06:06 UTC (permalink / raw) ObjectPropertyType.class_descr was originally intended for internal error messages, but is now also used in a translated error message. Mark the object class descriptions for translation and translate the return value of get_object_class_descr(). --- src/backend/catalog/objectaddress.c | 88 ++++++++++++++--------------- src/backend/catalog/pg_depend.c | 2 +- 2 files changed, 45 insertions(+), 45 deletions(-) diff --git a/src/backend/catalog/objectaddress.c b/src/backend/catalog/objectaddress.c index af0e4703616..12dc76b712a 100644 --- a/src/backend/catalog/objectaddress.c +++ b/src/backend/catalog/objectaddress.c @@ -100,8 +100,8 @@ */ typedef struct { - const char *class_descr; /* string describing the catalog, for internal - * error messages */ + const char *class_descr; /* string describing the catalog, for error + * messages */ Oid class_oid; /* oid of catalog */ Oid oid_index_oid; /* oid of index on system oid column */ SysCacheIdentifier oid_catcache_id; /* id of catcache on system oid column */ @@ -124,7 +124,7 @@ typedef struct static const ObjectPropertyType ObjectProperty[] = { { - "access method", + gettext_noop("access method"), AccessMethodRelationId, AmOidIndexId, AMOID, @@ -138,7 +138,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "access method operator", + gettext_noop("access method operator"), AccessMethodOperatorRelationId, AccessMethodOperatorOidIndexId, SYSCACHEID_INVALID, @@ -152,7 +152,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "access method procedure", + gettext_noop("access method procedure"), AccessMethodProcedureRelationId, AccessMethodProcedureOidIndexId, SYSCACHEID_INVALID, @@ -166,7 +166,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "cast", + gettext_noop("cast"), CastRelationId, CastOidIndexId, SYSCACHEID_INVALID, @@ -180,7 +180,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "collation", + gettext_noop("collation"), CollationRelationId, CollationOidIndexId, COLLOID, @@ -194,7 +194,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "constraint", + gettext_noop("constraint"), ConstraintRelationId, ConstraintOidIndexId, CONSTROID, @@ -208,7 +208,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "conversion", + gettext_noop("conversion"), ConversionRelationId, ConversionOidIndexId, CONVOID, @@ -222,7 +222,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "database", + gettext_noop("database"), DatabaseRelationId, DatabaseOidIndexId, DATABASEOID, @@ -236,7 +236,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "default ACL", + gettext_noop("default ACL"), DefaultAclRelationId, DefaultAclOidIndexId, SYSCACHEID_INVALID, @@ -250,7 +250,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "extension", + gettext_noop("extension"), ExtensionRelationId, ExtensionOidIndexId, SYSCACHEID_INVALID, @@ -264,7 +264,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "foreign-data wrapper", + gettext_noop("foreign-data wrapper"), ForeignDataWrapperRelationId, ForeignDataWrapperOidIndexId, FOREIGNDATAWRAPPEROID, @@ -278,7 +278,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "foreign server", + gettext_noop("foreign server"), ForeignServerRelationId, ForeignServerOidIndexId, FOREIGNSERVEROID, @@ -292,7 +292,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "function", + gettext_noop("function"), ProcedureRelationId, ProcedureOidIndexId, PROCOID, @@ -306,7 +306,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "language", + gettext_noop("language"), LanguageRelationId, LanguageOidIndexId, LANGOID, @@ -320,7 +320,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "large object metadata", + gettext_noop("large object metadata"), LargeObjectMetadataRelationId, LargeObjectMetadataOidIndexId, SYSCACHEID_INVALID, @@ -334,7 +334,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "operator class", + gettext_noop("operator class"), OperatorClassRelationId, OpclassOidIndexId, CLAOID, @@ -348,7 +348,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "operator", + gettext_noop("operator"), OperatorRelationId, OperatorOidIndexId, OPEROID, @@ -362,7 +362,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "operator family", + gettext_noop("operator family"), OperatorFamilyRelationId, OpfamilyOidIndexId, OPFAMILYOID, @@ -376,7 +376,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "property graph element", + gettext_noop("property graph element"), PropgraphElementRelationId, PropgraphElementObjectIndexId, PROPGRAPHELOID, @@ -390,7 +390,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph element label", + gettext_noop("property graph element label"), PropgraphElementLabelRelationId, PropgraphElementLabelObjectIndexId, -1, @@ -404,7 +404,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph label", + gettext_noop("property graph label"), PropgraphLabelRelationId, PropgraphLabelObjectIndexId, PROPGRAPHLABELOID, @@ -418,7 +418,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph label property", + gettext_noop("property graph label property"), PropgraphLabelPropertyRelationId, PropgraphLabelPropertyObjectIndexId, -1, @@ -432,7 +432,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph property", + gettext_noop("property graph property"), PropgraphPropertyRelationId, PropgraphPropertyObjectIndexId, -1, @@ -446,7 +446,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "role", + gettext_noop("role"), AuthIdRelationId, AuthIdOidIndexId, AUTHOID, @@ -460,7 +460,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "role membership", + gettext_noop("role membership"), AuthMemRelationId, AuthMemOidIndexId, SYSCACHEID_INVALID, @@ -474,7 +474,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "rule", + gettext_noop("rule"), RewriteRelationId, RewriteOidIndexId, SYSCACHEID_INVALID, @@ -488,7 +488,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "schema", + gettext_noop("schema"), NamespaceRelationId, NamespaceOidIndexId, NAMESPACEOID, @@ -502,7 +502,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "relation", + gettext_noop("relation"), RelationRelationId, ClassOidIndexId, RELOID, @@ -516,7 +516,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "tablespace", + gettext_noop("tablespace"), TableSpaceRelationId, TablespaceOidIndexId, TABLESPACEOID, @@ -530,7 +530,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "transform", + gettext_noop("transform"), TransformRelationId, TransformOidIndexId, TRFOID, @@ -544,7 +544,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "trigger", + gettext_noop("trigger"), TriggerRelationId, TriggerOidIndexId, SYSCACHEID_INVALID, @@ -558,7 +558,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "policy", + gettext_noop("policy"), PolicyRelationId, PolicyOidIndexId, SYSCACHEID_INVALID, @@ -572,7 +572,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "event trigger", + gettext_noop("event trigger"), EventTriggerRelationId, EventTriggerOidIndexId, EVENTTRIGGEROID, @@ -586,7 +586,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search configuration", + gettext_noop("text search configuration"), TSConfigRelationId, TSConfigOidIndexId, TSCONFIGOID, @@ -600,7 +600,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search dictionary", + gettext_noop("text search dictionary"), TSDictionaryRelationId, TSDictionaryOidIndexId, TSDICTOID, @@ -614,7 +614,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search parser", + gettext_noop("text search parser"), TSParserRelationId, TSParserOidIndexId, TSPARSEROID, @@ -628,7 +628,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search template", + gettext_noop("text search template"), TSTemplateRelationId, TSTemplateOidIndexId, TSTEMPLATEOID, @@ -642,7 +642,7 @@ static const ObjectPropertyType ObjectProperty[] = true, }, { - "type", + gettext_noop("type"), TypeRelationId, TypeOidIndexId, TYPEOID, @@ -656,7 +656,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "publication", + gettext_noop("publication"), PublicationRelationId, PublicationObjectIndexId, PUBLICATIONOID, @@ -670,7 +670,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "subscription", + gettext_noop("subscription"), SubscriptionRelationId, SubscriptionObjectIndexId, SUBSCRIPTIONOID, @@ -684,7 +684,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "extended statistics", + gettext_noop("extended statistics"), StatisticExtRelationId, StatisticExtOidIndexId, STATEXTOID, @@ -698,7 +698,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "user mapping", + gettext_noop("user mapping"), UserMappingRelationId, UserMappingOidIndexId, USERMAPPINGOID, diff --git a/src/backend/catalog/pg_depend.c b/src/backend/catalog/pg_depend.c index 9a7a401aced..0d28d34412d 100644 --- a/src/backend/catalog/pg_depend.c +++ b/src/backend/catalog/pg_depend.c @@ -810,7 +810,7 @@ dependencyLockAndCheckObject(Oid classId, Oid objectId) ereport(ERROR, (errcode(ERRCODE_UNDEFINED_OBJECT), errmsg("referenced %s was concurrently dropped", - get_object_class_descr(classId)))); + _(get_object_class_descr(classId))))); systable_endscan(scan); table_close(rel, AccessShareLock); -- 2.52.0 ----Next_Part(Fri_Jul__3_15_37_42_2026_665)---- ^ permalink raw reply [nested|flat] 34+ messages in thread
* [PATCH v1] Mark object class descriptions for translation @ 2026-07-03 06:06 Kyotaro Horiguchi <[email protected]> 0 siblings, 0 replies; 34+ messages in thread From: Kyotaro Horiguchi @ 2026-07-03 06:06 UTC (permalink / raw) ObjectPropertyType.class_descr was originally intended for internal error messages, but is now also used in a translated error message. Mark the object class descriptions for translation and translate the return value of get_object_class_descr(). --- src/backend/catalog/objectaddress.c | 88 ++++++++++++++--------------- src/backend/catalog/pg_depend.c | 2 +- 2 files changed, 45 insertions(+), 45 deletions(-) diff --git a/src/backend/catalog/objectaddress.c b/src/backend/catalog/objectaddress.c index af0e4703616..12dc76b712a 100644 --- a/src/backend/catalog/objectaddress.c +++ b/src/backend/catalog/objectaddress.c @@ -100,8 +100,8 @@ */ typedef struct { - const char *class_descr; /* string describing the catalog, for internal - * error messages */ + const char *class_descr; /* string describing the catalog, for error + * messages */ Oid class_oid; /* oid of catalog */ Oid oid_index_oid; /* oid of index on system oid column */ SysCacheIdentifier oid_catcache_id; /* id of catcache on system oid column */ @@ -124,7 +124,7 @@ typedef struct static const ObjectPropertyType ObjectProperty[] = { { - "access method", + gettext_noop("access method"), AccessMethodRelationId, AmOidIndexId, AMOID, @@ -138,7 +138,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "access method operator", + gettext_noop("access method operator"), AccessMethodOperatorRelationId, AccessMethodOperatorOidIndexId, SYSCACHEID_INVALID, @@ -152,7 +152,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "access method procedure", + gettext_noop("access method procedure"), AccessMethodProcedureRelationId, AccessMethodProcedureOidIndexId, SYSCACHEID_INVALID, @@ -166,7 +166,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "cast", + gettext_noop("cast"), CastRelationId, CastOidIndexId, SYSCACHEID_INVALID, @@ -180,7 +180,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "collation", + gettext_noop("collation"), CollationRelationId, CollationOidIndexId, COLLOID, @@ -194,7 +194,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "constraint", + gettext_noop("constraint"), ConstraintRelationId, ConstraintOidIndexId, CONSTROID, @@ -208,7 +208,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "conversion", + gettext_noop("conversion"), ConversionRelationId, ConversionOidIndexId, CONVOID, @@ -222,7 +222,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "database", + gettext_noop("database"), DatabaseRelationId, DatabaseOidIndexId, DATABASEOID, @@ -236,7 +236,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "default ACL", + gettext_noop("default ACL"), DefaultAclRelationId, DefaultAclOidIndexId, SYSCACHEID_INVALID, @@ -250,7 +250,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "extension", + gettext_noop("extension"), ExtensionRelationId, ExtensionOidIndexId, SYSCACHEID_INVALID, @@ -264,7 +264,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "foreign-data wrapper", + gettext_noop("foreign-data wrapper"), ForeignDataWrapperRelationId, ForeignDataWrapperOidIndexId, FOREIGNDATAWRAPPEROID, @@ -278,7 +278,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "foreign server", + gettext_noop("foreign server"), ForeignServerRelationId, ForeignServerOidIndexId, FOREIGNSERVEROID, @@ -292,7 +292,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "function", + gettext_noop("function"), ProcedureRelationId, ProcedureOidIndexId, PROCOID, @@ -306,7 +306,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "language", + gettext_noop("language"), LanguageRelationId, LanguageOidIndexId, LANGOID, @@ -320,7 +320,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "large object metadata", + gettext_noop("large object metadata"), LargeObjectMetadataRelationId, LargeObjectMetadataOidIndexId, SYSCACHEID_INVALID, @@ -334,7 +334,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "operator class", + gettext_noop("operator class"), OperatorClassRelationId, OpclassOidIndexId, CLAOID, @@ -348,7 +348,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "operator", + gettext_noop("operator"), OperatorRelationId, OperatorOidIndexId, OPEROID, @@ -362,7 +362,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "operator family", + gettext_noop("operator family"), OperatorFamilyRelationId, OpfamilyOidIndexId, OPFAMILYOID, @@ -376,7 +376,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "property graph element", + gettext_noop("property graph element"), PropgraphElementRelationId, PropgraphElementObjectIndexId, PROPGRAPHELOID, @@ -390,7 +390,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph element label", + gettext_noop("property graph element label"), PropgraphElementLabelRelationId, PropgraphElementLabelObjectIndexId, -1, @@ -404,7 +404,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph label", + gettext_noop("property graph label"), PropgraphLabelRelationId, PropgraphLabelObjectIndexId, PROPGRAPHLABELOID, @@ -418,7 +418,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph label property", + gettext_noop("property graph label property"), PropgraphLabelPropertyRelationId, PropgraphLabelPropertyObjectIndexId, -1, @@ -432,7 +432,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph property", + gettext_noop("property graph property"), PropgraphPropertyRelationId, PropgraphPropertyObjectIndexId, -1, @@ -446,7 +446,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "role", + gettext_noop("role"), AuthIdRelationId, AuthIdOidIndexId, AUTHOID, @@ -460,7 +460,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "role membership", + gettext_noop("role membership"), AuthMemRelationId, AuthMemOidIndexId, SYSCACHEID_INVALID, @@ -474,7 +474,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "rule", + gettext_noop("rule"), RewriteRelationId, RewriteOidIndexId, SYSCACHEID_INVALID, @@ -488,7 +488,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "schema", + gettext_noop("schema"), NamespaceRelationId, NamespaceOidIndexId, NAMESPACEOID, @@ -502,7 +502,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "relation", + gettext_noop("relation"), RelationRelationId, ClassOidIndexId, RELOID, @@ -516,7 +516,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "tablespace", + gettext_noop("tablespace"), TableSpaceRelationId, TablespaceOidIndexId, TABLESPACEOID, @@ -530,7 +530,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "transform", + gettext_noop("transform"), TransformRelationId, TransformOidIndexId, TRFOID, @@ -544,7 +544,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "trigger", + gettext_noop("trigger"), TriggerRelationId, TriggerOidIndexId, SYSCACHEID_INVALID, @@ -558,7 +558,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "policy", + gettext_noop("policy"), PolicyRelationId, PolicyOidIndexId, SYSCACHEID_INVALID, @@ -572,7 +572,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "event trigger", + gettext_noop("event trigger"), EventTriggerRelationId, EventTriggerOidIndexId, EVENTTRIGGEROID, @@ -586,7 +586,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search configuration", + gettext_noop("text search configuration"), TSConfigRelationId, TSConfigOidIndexId, TSCONFIGOID, @@ -600,7 +600,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search dictionary", + gettext_noop("text search dictionary"), TSDictionaryRelationId, TSDictionaryOidIndexId, TSDICTOID, @@ -614,7 +614,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search parser", + gettext_noop("text search parser"), TSParserRelationId, TSParserOidIndexId, TSPARSEROID, @@ -628,7 +628,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search template", + gettext_noop("text search template"), TSTemplateRelationId, TSTemplateOidIndexId, TSTEMPLATEOID, @@ -642,7 +642,7 @@ static const ObjectPropertyType ObjectProperty[] = true, }, { - "type", + gettext_noop("type"), TypeRelationId, TypeOidIndexId, TYPEOID, @@ -656,7 +656,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "publication", + gettext_noop("publication"), PublicationRelationId, PublicationObjectIndexId, PUBLICATIONOID, @@ -670,7 +670,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "subscription", + gettext_noop("subscription"), SubscriptionRelationId, SubscriptionObjectIndexId, SUBSCRIPTIONOID, @@ -684,7 +684,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "extended statistics", + gettext_noop("extended statistics"), StatisticExtRelationId, StatisticExtOidIndexId, STATEXTOID, @@ -698,7 +698,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "user mapping", + gettext_noop("user mapping"), UserMappingRelationId, UserMappingOidIndexId, USERMAPPINGOID, diff --git a/src/backend/catalog/pg_depend.c b/src/backend/catalog/pg_depend.c index 9a7a401aced..0d28d34412d 100644 --- a/src/backend/catalog/pg_depend.c +++ b/src/backend/catalog/pg_depend.c @@ -810,7 +810,7 @@ dependencyLockAndCheckObject(Oid classId, Oid objectId) ereport(ERROR, (errcode(ERRCODE_UNDEFINED_OBJECT), errmsg("referenced %s was concurrently dropped", - get_object_class_descr(classId)))); + _(get_object_class_descr(classId))))); systable_endscan(scan); table_close(rel, AccessShareLock); -- 2.52.0 ----Next_Part(Fri_Jul__3_15_37_42_2026_665)---- ^ permalink raw reply [nested|flat] 34+ messages in thread
* [PATCH v1] Mark object class descriptions for translation @ 2026-07-03 06:06 Kyotaro Horiguchi <[email protected]> 0 siblings, 0 replies; 34+ messages in thread From: Kyotaro Horiguchi @ 2026-07-03 06:06 UTC (permalink / raw) ObjectPropertyType.class_descr was originally intended for internal error messages, but is now also used in a translated error message. Mark the object class descriptions for translation and translate the return value of get_object_class_descr(). --- src/backend/catalog/objectaddress.c | 88 ++++++++++++++--------------- src/backend/catalog/pg_depend.c | 2 +- 2 files changed, 45 insertions(+), 45 deletions(-) diff --git a/src/backend/catalog/objectaddress.c b/src/backend/catalog/objectaddress.c index af0e4703616..12dc76b712a 100644 --- a/src/backend/catalog/objectaddress.c +++ b/src/backend/catalog/objectaddress.c @@ -100,8 +100,8 @@ */ typedef struct { - const char *class_descr; /* string describing the catalog, for internal - * error messages */ + const char *class_descr; /* string describing the catalog, for error + * messages */ Oid class_oid; /* oid of catalog */ Oid oid_index_oid; /* oid of index on system oid column */ SysCacheIdentifier oid_catcache_id; /* id of catcache on system oid column */ @@ -124,7 +124,7 @@ typedef struct static const ObjectPropertyType ObjectProperty[] = { { - "access method", + gettext_noop("access method"), AccessMethodRelationId, AmOidIndexId, AMOID, @@ -138,7 +138,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "access method operator", + gettext_noop("access method operator"), AccessMethodOperatorRelationId, AccessMethodOperatorOidIndexId, SYSCACHEID_INVALID, @@ -152,7 +152,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "access method procedure", + gettext_noop("access method procedure"), AccessMethodProcedureRelationId, AccessMethodProcedureOidIndexId, SYSCACHEID_INVALID, @@ -166,7 +166,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "cast", + gettext_noop("cast"), CastRelationId, CastOidIndexId, SYSCACHEID_INVALID, @@ -180,7 +180,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "collation", + gettext_noop("collation"), CollationRelationId, CollationOidIndexId, COLLOID, @@ -194,7 +194,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "constraint", + gettext_noop("constraint"), ConstraintRelationId, ConstraintOidIndexId, CONSTROID, @@ -208,7 +208,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "conversion", + gettext_noop("conversion"), ConversionRelationId, ConversionOidIndexId, CONVOID, @@ -222,7 +222,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "database", + gettext_noop("database"), DatabaseRelationId, DatabaseOidIndexId, DATABASEOID, @@ -236,7 +236,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "default ACL", + gettext_noop("default ACL"), DefaultAclRelationId, DefaultAclOidIndexId, SYSCACHEID_INVALID, @@ -250,7 +250,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "extension", + gettext_noop("extension"), ExtensionRelationId, ExtensionOidIndexId, SYSCACHEID_INVALID, @@ -264,7 +264,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "foreign-data wrapper", + gettext_noop("foreign-data wrapper"), ForeignDataWrapperRelationId, ForeignDataWrapperOidIndexId, FOREIGNDATAWRAPPEROID, @@ -278,7 +278,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "foreign server", + gettext_noop("foreign server"), ForeignServerRelationId, ForeignServerOidIndexId, FOREIGNSERVEROID, @@ -292,7 +292,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "function", + gettext_noop("function"), ProcedureRelationId, ProcedureOidIndexId, PROCOID, @@ -306,7 +306,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "language", + gettext_noop("language"), LanguageRelationId, LanguageOidIndexId, LANGOID, @@ -320,7 +320,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "large object metadata", + gettext_noop("large object metadata"), LargeObjectMetadataRelationId, LargeObjectMetadataOidIndexId, SYSCACHEID_INVALID, @@ -334,7 +334,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "operator class", + gettext_noop("operator class"), OperatorClassRelationId, OpclassOidIndexId, CLAOID, @@ -348,7 +348,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "operator", + gettext_noop("operator"), OperatorRelationId, OperatorOidIndexId, OPEROID, @@ -362,7 +362,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "operator family", + gettext_noop("operator family"), OperatorFamilyRelationId, OpfamilyOidIndexId, OPFAMILYOID, @@ -376,7 +376,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "property graph element", + gettext_noop("property graph element"), PropgraphElementRelationId, PropgraphElementObjectIndexId, PROPGRAPHELOID, @@ -390,7 +390,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph element label", + gettext_noop("property graph element label"), PropgraphElementLabelRelationId, PropgraphElementLabelObjectIndexId, -1, @@ -404,7 +404,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph label", + gettext_noop("property graph label"), PropgraphLabelRelationId, PropgraphLabelObjectIndexId, PROPGRAPHLABELOID, @@ -418,7 +418,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph label property", + gettext_noop("property graph label property"), PropgraphLabelPropertyRelationId, PropgraphLabelPropertyObjectIndexId, -1, @@ -432,7 +432,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph property", + gettext_noop("property graph property"), PropgraphPropertyRelationId, PropgraphPropertyObjectIndexId, -1, @@ -446,7 +446,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "role", + gettext_noop("role"), AuthIdRelationId, AuthIdOidIndexId, AUTHOID, @@ -460,7 +460,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "role membership", + gettext_noop("role membership"), AuthMemRelationId, AuthMemOidIndexId, SYSCACHEID_INVALID, @@ -474,7 +474,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "rule", + gettext_noop("rule"), RewriteRelationId, RewriteOidIndexId, SYSCACHEID_INVALID, @@ -488,7 +488,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "schema", + gettext_noop("schema"), NamespaceRelationId, NamespaceOidIndexId, NAMESPACEOID, @@ -502,7 +502,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "relation", + gettext_noop("relation"), RelationRelationId, ClassOidIndexId, RELOID, @@ -516,7 +516,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "tablespace", + gettext_noop("tablespace"), TableSpaceRelationId, TablespaceOidIndexId, TABLESPACEOID, @@ -530,7 +530,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "transform", + gettext_noop("transform"), TransformRelationId, TransformOidIndexId, TRFOID, @@ -544,7 +544,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "trigger", + gettext_noop("trigger"), TriggerRelationId, TriggerOidIndexId, SYSCACHEID_INVALID, @@ -558,7 +558,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "policy", + gettext_noop("policy"), PolicyRelationId, PolicyOidIndexId, SYSCACHEID_INVALID, @@ -572,7 +572,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "event trigger", + gettext_noop("event trigger"), EventTriggerRelationId, EventTriggerOidIndexId, EVENTTRIGGEROID, @@ -586,7 +586,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search configuration", + gettext_noop("text search configuration"), TSConfigRelationId, TSConfigOidIndexId, TSCONFIGOID, @@ -600,7 +600,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search dictionary", + gettext_noop("text search dictionary"), TSDictionaryRelationId, TSDictionaryOidIndexId, TSDICTOID, @@ -614,7 +614,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search parser", + gettext_noop("text search parser"), TSParserRelationId, TSParserOidIndexId, TSPARSEROID, @@ -628,7 +628,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search template", + gettext_noop("text search template"), TSTemplateRelationId, TSTemplateOidIndexId, TSTEMPLATEOID, @@ -642,7 +642,7 @@ static const ObjectPropertyType ObjectProperty[] = true, }, { - "type", + gettext_noop("type"), TypeRelationId, TypeOidIndexId, TYPEOID, @@ -656,7 +656,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "publication", + gettext_noop("publication"), PublicationRelationId, PublicationObjectIndexId, PUBLICATIONOID, @@ -670,7 +670,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "subscription", + gettext_noop("subscription"), SubscriptionRelationId, SubscriptionObjectIndexId, SUBSCRIPTIONOID, @@ -684,7 +684,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "extended statistics", + gettext_noop("extended statistics"), StatisticExtRelationId, StatisticExtOidIndexId, STATEXTOID, @@ -698,7 +698,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "user mapping", + gettext_noop("user mapping"), UserMappingRelationId, UserMappingOidIndexId, USERMAPPINGOID, diff --git a/src/backend/catalog/pg_depend.c b/src/backend/catalog/pg_depend.c index 9a7a401aced..0d28d34412d 100644 --- a/src/backend/catalog/pg_depend.c +++ b/src/backend/catalog/pg_depend.c @@ -810,7 +810,7 @@ dependencyLockAndCheckObject(Oid classId, Oid objectId) ereport(ERROR, (errcode(ERRCODE_UNDEFINED_OBJECT), errmsg("referenced %s was concurrently dropped", - get_object_class_descr(classId)))); + _(get_object_class_descr(classId))))); systable_endscan(scan); table_close(rel, AccessShareLock); -- 2.52.0 ----Next_Part(Fri_Jul__3_15_37_42_2026_665)---- ^ permalink raw reply [nested|flat] 34+ messages in thread
* [PATCH v1] Mark object class descriptions for translation @ 2026-07-03 06:06 Kyotaro Horiguchi <[email protected]> 0 siblings, 0 replies; 34+ messages in thread From: Kyotaro Horiguchi @ 2026-07-03 06:06 UTC (permalink / raw) ObjectPropertyType.class_descr was originally intended for internal error messages, but is now also used in a translated error message. Mark the object class descriptions for translation and translate the return value of get_object_class_descr(). --- src/backend/catalog/objectaddress.c | 88 ++++++++++++++--------------- src/backend/catalog/pg_depend.c | 2 +- 2 files changed, 45 insertions(+), 45 deletions(-) diff --git a/src/backend/catalog/objectaddress.c b/src/backend/catalog/objectaddress.c index af0e4703616..12dc76b712a 100644 --- a/src/backend/catalog/objectaddress.c +++ b/src/backend/catalog/objectaddress.c @@ -100,8 +100,8 @@ */ typedef struct { - const char *class_descr; /* string describing the catalog, for internal - * error messages */ + const char *class_descr; /* string describing the catalog, for error + * messages */ Oid class_oid; /* oid of catalog */ Oid oid_index_oid; /* oid of index on system oid column */ SysCacheIdentifier oid_catcache_id; /* id of catcache on system oid column */ @@ -124,7 +124,7 @@ typedef struct static const ObjectPropertyType ObjectProperty[] = { { - "access method", + gettext_noop("access method"), AccessMethodRelationId, AmOidIndexId, AMOID, @@ -138,7 +138,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "access method operator", + gettext_noop("access method operator"), AccessMethodOperatorRelationId, AccessMethodOperatorOidIndexId, SYSCACHEID_INVALID, @@ -152,7 +152,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "access method procedure", + gettext_noop("access method procedure"), AccessMethodProcedureRelationId, AccessMethodProcedureOidIndexId, SYSCACHEID_INVALID, @@ -166,7 +166,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "cast", + gettext_noop("cast"), CastRelationId, CastOidIndexId, SYSCACHEID_INVALID, @@ -180,7 +180,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "collation", + gettext_noop("collation"), CollationRelationId, CollationOidIndexId, COLLOID, @@ -194,7 +194,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "constraint", + gettext_noop("constraint"), ConstraintRelationId, ConstraintOidIndexId, CONSTROID, @@ -208,7 +208,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "conversion", + gettext_noop("conversion"), ConversionRelationId, ConversionOidIndexId, CONVOID, @@ -222,7 +222,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "database", + gettext_noop("database"), DatabaseRelationId, DatabaseOidIndexId, DATABASEOID, @@ -236,7 +236,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "default ACL", + gettext_noop("default ACL"), DefaultAclRelationId, DefaultAclOidIndexId, SYSCACHEID_INVALID, @@ -250,7 +250,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "extension", + gettext_noop("extension"), ExtensionRelationId, ExtensionOidIndexId, SYSCACHEID_INVALID, @@ -264,7 +264,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "foreign-data wrapper", + gettext_noop("foreign-data wrapper"), ForeignDataWrapperRelationId, ForeignDataWrapperOidIndexId, FOREIGNDATAWRAPPEROID, @@ -278,7 +278,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "foreign server", + gettext_noop("foreign server"), ForeignServerRelationId, ForeignServerOidIndexId, FOREIGNSERVEROID, @@ -292,7 +292,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "function", + gettext_noop("function"), ProcedureRelationId, ProcedureOidIndexId, PROCOID, @@ -306,7 +306,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "language", + gettext_noop("language"), LanguageRelationId, LanguageOidIndexId, LANGOID, @@ -320,7 +320,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "large object metadata", + gettext_noop("large object metadata"), LargeObjectMetadataRelationId, LargeObjectMetadataOidIndexId, SYSCACHEID_INVALID, @@ -334,7 +334,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "operator class", + gettext_noop("operator class"), OperatorClassRelationId, OpclassOidIndexId, CLAOID, @@ -348,7 +348,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "operator", + gettext_noop("operator"), OperatorRelationId, OperatorOidIndexId, OPEROID, @@ -362,7 +362,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "operator family", + gettext_noop("operator family"), OperatorFamilyRelationId, OpfamilyOidIndexId, OPFAMILYOID, @@ -376,7 +376,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "property graph element", + gettext_noop("property graph element"), PropgraphElementRelationId, PropgraphElementObjectIndexId, PROPGRAPHELOID, @@ -390,7 +390,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph element label", + gettext_noop("property graph element label"), PropgraphElementLabelRelationId, PropgraphElementLabelObjectIndexId, -1, @@ -404,7 +404,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph label", + gettext_noop("property graph label"), PropgraphLabelRelationId, PropgraphLabelObjectIndexId, PROPGRAPHLABELOID, @@ -418,7 +418,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph label property", + gettext_noop("property graph label property"), PropgraphLabelPropertyRelationId, PropgraphLabelPropertyObjectIndexId, -1, @@ -432,7 +432,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph property", + gettext_noop("property graph property"), PropgraphPropertyRelationId, PropgraphPropertyObjectIndexId, -1, @@ -446,7 +446,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "role", + gettext_noop("role"), AuthIdRelationId, AuthIdOidIndexId, AUTHOID, @@ -460,7 +460,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "role membership", + gettext_noop("role membership"), AuthMemRelationId, AuthMemOidIndexId, SYSCACHEID_INVALID, @@ -474,7 +474,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "rule", + gettext_noop("rule"), RewriteRelationId, RewriteOidIndexId, SYSCACHEID_INVALID, @@ -488,7 +488,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "schema", + gettext_noop("schema"), NamespaceRelationId, NamespaceOidIndexId, NAMESPACEOID, @@ -502,7 +502,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "relation", + gettext_noop("relation"), RelationRelationId, ClassOidIndexId, RELOID, @@ -516,7 +516,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "tablespace", + gettext_noop("tablespace"), TableSpaceRelationId, TablespaceOidIndexId, TABLESPACEOID, @@ -530,7 +530,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "transform", + gettext_noop("transform"), TransformRelationId, TransformOidIndexId, TRFOID, @@ -544,7 +544,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "trigger", + gettext_noop("trigger"), TriggerRelationId, TriggerOidIndexId, SYSCACHEID_INVALID, @@ -558,7 +558,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "policy", + gettext_noop("policy"), PolicyRelationId, PolicyOidIndexId, SYSCACHEID_INVALID, @@ -572,7 +572,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "event trigger", + gettext_noop("event trigger"), EventTriggerRelationId, EventTriggerOidIndexId, EVENTTRIGGEROID, @@ -586,7 +586,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search configuration", + gettext_noop("text search configuration"), TSConfigRelationId, TSConfigOidIndexId, TSCONFIGOID, @@ -600,7 +600,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search dictionary", + gettext_noop("text search dictionary"), TSDictionaryRelationId, TSDictionaryOidIndexId, TSDICTOID, @@ -614,7 +614,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search parser", + gettext_noop("text search parser"), TSParserRelationId, TSParserOidIndexId, TSPARSEROID, @@ -628,7 +628,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search template", + gettext_noop("text search template"), TSTemplateRelationId, TSTemplateOidIndexId, TSTEMPLATEOID, @@ -642,7 +642,7 @@ static const ObjectPropertyType ObjectProperty[] = true, }, { - "type", + gettext_noop("type"), TypeRelationId, TypeOidIndexId, TYPEOID, @@ -656,7 +656,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "publication", + gettext_noop("publication"), PublicationRelationId, PublicationObjectIndexId, PUBLICATIONOID, @@ -670,7 +670,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "subscription", + gettext_noop("subscription"), SubscriptionRelationId, SubscriptionObjectIndexId, SUBSCRIPTIONOID, @@ -684,7 +684,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "extended statistics", + gettext_noop("extended statistics"), StatisticExtRelationId, StatisticExtOidIndexId, STATEXTOID, @@ -698,7 +698,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "user mapping", + gettext_noop("user mapping"), UserMappingRelationId, UserMappingOidIndexId, USERMAPPINGOID, diff --git a/src/backend/catalog/pg_depend.c b/src/backend/catalog/pg_depend.c index 9a7a401aced..0d28d34412d 100644 --- a/src/backend/catalog/pg_depend.c +++ b/src/backend/catalog/pg_depend.c @@ -810,7 +810,7 @@ dependencyLockAndCheckObject(Oid classId, Oid objectId) ereport(ERROR, (errcode(ERRCODE_UNDEFINED_OBJECT), errmsg("referenced %s was concurrently dropped", - get_object_class_descr(classId)))); + _(get_object_class_descr(classId))))); systable_endscan(scan); table_close(rel, AccessShareLock); -- 2.52.0 ----Next_Part(Fri_Jul__3_15_37_42_2026_665)---- ^ permalink raw reply [nested|flat] 34+ messages in thread
* [PATCH v1] Mark object class descriptions for translation @ 2026-07-03 06:06 Kyotaro Horiguchi <[email protected]> 0 siblings, 0 replies; 34+ messages in thread From: Kyotaro Horiguchi @ 2026-07-03 06:06 UTC (permalink / raw) ObjectPropertyType.class_descr was originally intended for internal error messages, but is now also used in a translated error message. Mark the object class descriptions for translation and translate the return value of get_object_class_descr(). --- src/backend/catalog/objectaddress.c | 88 ++++++++++++++--------------- src/backend/catalog/pg_depend.c | 2 +- 2 files changed, 45 insertions(+), 45 deletions(-) diff --git a/src/backend/catalog/objectaddress.c b/src/backend/catalog/objectaddress.c index af0e4703616..12dc76b712a 100644 --- a/src/backend/catalog/objectaddress.c +++ b/src/backend/catalog/objectaddress.c @@ -100,8 +100,8 @@ */ typedef struct { - const char *class_descr; /* string describing the catalog, for internal - * error messages */ + const char *class_descr; /* string describing the catalog, for error + * messages */ Oid class_oid; /* oid of catalog */ Oid oid_index_oid; /* oid of index on system oid column */ SysCacheIdentifier oid_catcache_id; /* id of catcache on system oid column */ @@ -124,7 +124,7 @@ typedef struct static const ObjectPropertyType ObjectProperty[] = { { - "access method", + gettext_noop("access method"), AccessMethodRelationId, AmOidIndexId, AMOID, @@ -138,7 +138,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "access method operator", + gettext_noop("access method operator"), AccessMethodOperatorRelationId, AccessMethodOperatorOidIndexId, SYSCACHEID_INVALID, @@ -152,7 +152,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "access method procedure", + gettext_noop("access method procedure"), AccessMethodProcedureRelationId, AccessMethodProcedureOidIndexId, SYSCACHEID_INVALID, @@ -166,7 +166,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "cast", + gettext_noop("cast"), CastRelationId, CastOidIndexId, SYSCACHEID_INVALID, @@ -180,7 +180,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "collation", + gettext_noop("collation"), CollationRelationId, CollationOidIndexId, COLLOID, @@ -194,7 +194,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "constraint", + gettext_noop("constraint"), ConstraintRelationId, ConstraintOidIndexId, CONSTROID, @@ -208,7 +208,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "conversion", + gettext_noop("conversion"), ConversionRelationId, ConversionOidIndexId, CONVOID, @@ -222,7 +222,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "database", + gettext_noop("database"), DatabaseRelationId, DatabaseOidIndexId, DATABASEOID, @@ -236,7 +236,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "default ACL", + gettext_noop("default ACL"), DefaultAclRelationId, DefaultAclOidIndexId, SYSCACHEID_INVALID, @@ -250,7 +250,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "extension", + gettext_noop("extension"), ExtensionRelationId, ExtensionOidIndexId, SYSCACHEID_INVALID, @@ -264,7 +264,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "foreign-data wrapper", + gettext_noop("foreign-data wrapper"), ForeignDataWrapperRelationId, ForeignDataWrapperOidIndexId, FOREIGNDATAWRAPPEROID, @@ -278,7 +278,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "foreign server", + gettext_noop("foreign server"), ForeignServerRelationId, ForeignServerOidIndexId, FOREIGNSERVEROID, @@ -292,7 +292,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "function", + gettext_noop("function"), ProcedureRelationId, ProcedureOidIndexId, PROCOID, @@ -306,7 +306,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "language", + gettext_noop("language"), LanguageRelationId, LanguageOidIndexId, LANGOID, @@ -320,7 +320,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "large object metadata", + gettext_noop("large object metadata"), LargeObjectMetadataRelationId, LargeObjectMetadataOidIndexId, SYSCACHEID_INVALID, @@ -334,7 +334,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "operator class", + gettext_noop("operator class"), OperatorClassRelationId, OpclassOidIndexId, CLAOID, @@ -348,7 +348,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "operator", + gettext_noop("operator"), OperatorRelationId, OperatorOidIndexId, OPEROID, @@ -362,7 +362,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "operator family", + gettext_noop("operator family"), OperatorFamilyRelationId, OpfamilyOidIndexId, OPFAMILYOID, @@ -376,7 +376,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "property graph element", + gettext_noop("property graph element"), PropgraphElementRelationId, PropgraphElementObjectIndexId, PROPGRAPHELOID, @@ -390,7 +390,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph element label", + gettext_noop("property graph element label"), PropgraphElementLabelRelationId, PropgraphElementLabelObjectIndexId, -1, @@ -404,7 +404,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph label", + gettext_noop("property graph label"), PropgraphLabelRelationId, PropgraphLabelObjectIndexId, PROPGRAPHLABELOID, @@ -418,7 +418,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph label property", + gettext_noop("property graph label property"), PropgraphLabelPropertyRelationId, PropgraphLabelPropertyObjectIndexId, -1, @@ -432,7 +432,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph property", + gettext_noop("property graph property"), PropgraphPropertyRelationId, PropgraphPropertyObjectIndexId, -1, @@ -446,7 +446,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "role", + gettext_noop("role"), AuthIdRelationId, AuthIdOidIndexId, AUTHOID, @@ -460,7 +460,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "role membership", + gettext_noop("role membership"), AuthMemRelationId, AuthMemOidIndexId, SYSCACHEID_INVALID, @@ -474,7 +474,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "rule", + gettext_noop("rule"), RewriteRelationId, RewriteOidIndexId, SYSCACHEID_INVALID, @@ -488,7 +488,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "schema", + gettext_noop("schema"), NamespaceRelationId, NamespaceOidIndexId, NAMESPACEOID, @@ -502,7 +502,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "relation", + gettext_noop("relation"), RelationRelationId, ClassOidIndexId, RELOID, @@ -516,7 +516,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "tablespace", + gettext_noop("tablespace"), TableSpaceRelationId, TablespaceOidIndexId, TABLESPACEOID, @@ -530,7 +530,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "transform", + gettext_noop("transform"), TransformRelationId, TransformOidIndexId, TRFOID, @@ -544,7 +544,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "trigger", + gettext_noop("trigger"), TriggerRelationId, TriggerOidIndexId, SYSCACHEID_INVALID, @@ -558,7 +558,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "policy", + gettext_noop("policy"), PolicyRelationId, PolicyOidIndexId, SYSCACHEID_INVALID, @@ -572,7 +572,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "event trigger", + gettext_noop("event trigger"), EventTriggerRelationId, EventTriggerOidIndexId, EVENTTRIGGEROID, @@ -586,7 +586,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search configuration", + gettext_noop("text search configuration"), TSConfigRelationId, TSConfigOidIndexId, TSCONFIGOID, @@ -600,7 +600,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search dictionary", + gettext_noop("text search dictionary"), TSDictionaryRelationId, TSDictionaryOidIndexId, TSDICTOID, @@ -614,7 +614,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search parser", + gettext_noop("text search parser"), TSParserRelationId, TSParserOidIndexId, TSPARSEROID, @@ -628,7 +628,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search template", + gettext_noop("text search template"), TSTemplateRelationId, TSTemplateOidIndexId, TSTEMPLATEOID, @@ -642,7 +642,7 @@ static const ObjectPropertyType ObjectProperty[] = true, }, { - "type", + gettext_noop("type"), TypeRelationId, TypeOidIndexId, TYPEOID, @@ -656,7 +656,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "publication", + gettext_noop("publication"), PublicationRelationId, PublicationObjectIndexId, PUBLICATIONOID, @@ -670,7 +670,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "subscription", + gettext_noop("subscription"), SubscriptionRelationId, SubscriptionObjectIndexId, SUBSCRIPTIONOID, @@ -684,7 +684,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "extended statistics", + gettext_noop("extended statistics"), StatisticExtRelationId, StatisticExtOidIndexId, STATEXTOID, @@ -698,7 +698,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "user mapping", + gettext_noop("user mapping"), UserMappingRelationId, UserMappingOidIndexId, USERMAPPINGOID, diff --git a/src/backend/catalog/pg_depend.c b/src/backend/catalog/pg_depend.c index 9a7a401aced..0d28d34412d 100644 --- a/src/backend/catalog/pg_depend.c +++ b/src/backend/catalog/pg_depend.c @@ -810,7 +810,7 @@ dependencyLockAndCheckObject(Oid classId, Oid objectId) ereport(ERROR, (errcode(ERRCODE_UNDEFINED_OBJECT), errmsg("referenced %s was concurrently dropped", - get_object_class_descr(classId)))); + _(get_object_class_descr(classId))))); systable_endscan(scan); table_close(rel, AccessShareLock); -- 2.52.0 ----Next_Part(Fri_Jul__3_15_37_42_2026_665)---- ^ permalink raw reply [nested|flat] 34+ messages in thread
* [PATCH v1] Mark object class descriptions for translation @ 2026-07-03 06:06 Kyotaro Horiguchi <[email protected]> 0 siblings, 0 replies; 34+ messages in thread From: Kyotaro Horiguchi @ 2026-07-03 06:06 UTC (permalink / raw) ObjectPropertyType.class_descr was originally intended for internal error messages, but is now also used in a translated error message. Mark the object class descriptions for translation and translate the return value of get_object_class_descr(). --- src/backend/catalog/objectaddress.c | 88 ++++++++++++++--------------- src/backend/catalog/pg_depend.c | 2 +- 2 files changed, 45 insertions(+), 45 deletions(-) diff --git a/src/backend/catalog/objectaddress.c b/src/backend/catalog/objectaddress.c index af0e4703616..12dc76b712a 100644 --- a/src/backend/catalog/objectaddress.c +++ b/src/backend/catalog/objectaddress.c @@ -100,8 +100,8 @@ */ typedef struct { - const char *class_descr; /* string describing the catalog, for internal - * error messages */ + const char *class_descr; /* string describing the catalog, for error + * messages */ Oid class_oid; /* oid of catalog */ Oid oid_index_oid; /* oid of index on system oid column */ SysCacheIdentifier oid_catcache_id; /* id of catcache on system oid column */ @@ -124,7 +124,7 @@ typedef struct static const ObjectPropertyType ObjectProperty[] = { { - "access method", + gettext_noop("access method"), AccessMethodRelationId, AmOidIndexId, AMOID, @@ -138,7 +138,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "access method operator", + gettext_noop("access method operator"), AccessMethodOperatorRelationId, AccessMethodOperatorOidIndexId, SYSCACHEID_INVALID, @@ -152,7 +152,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "access method procedure", + gettext_noop("access method procedure"), AccessMethodProcedureRelationId, AccessMethodProcedureOidIndexId, SYSCACHEID_INVALID, @@ -166,7 +166,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "cast", + gettext_noop("cast"), CastRelationId, CastOidIndexId, SYSCACHEID_INVALID, @@ -180,7 +180,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "collation", + gettext_noop("collation"), CollationRelationId, CollationOidIndexId, COLLOID, @@ -194,7 +194,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "constraint", + gettext_noop("constraint"), ConstraintRelationId, ConstraintOidIndexId, CONSTROID, @@ -208,7 +208,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "conversion", + gettext_noop("conversion"), ConversionRelationId, ConversionOidIndexId, CONVOID, @@ -222,7 +222,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "database", + gettext_noop("database"), DatabaseRelationId, DatabaseOidIndexId, DATABASEOID, @@ -236,7 +236,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "default ACL", + gettext_noop("default ACL"), DefaultAclRelationId, DefaultAclOidIndexId, SYSCACHEID_INVALID, @@ -250,7 +250,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "extension", + gettext_noop("extension"), ExtensionRelationId, ExtensionOidIndexId, SYSCACHEID_INVALID, @@ -264,7 +264,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "foreign-data wrapper", + gettext_noop("foreign-data wrapper"), ForeignDataWrapperRelationId, ForeignDataWrapperOidIndexId, FOREIGNDATAWRAPPEROID, @@ -278,7 +278,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "foreign server", + gettext_noop("foreign server"), ForeignServerRelationId, ForeignServerOidIndexId, FOREIGNSERVEROID, @@ -292,7 +292,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "function", + gettext_noop("function"), ProcedureRelationId, ProcedureOidIndexId, PROCOID, @@ -306,7 +306,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "language", + gettext_noop("language"), LanguageRelationId, LanguageOidIndexId, LANGOID, @@ -320,7 +320,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "large object metadata", + gettext_noop("large object metadata"), LargeObjectMetadataRelationId, LargeObjectMetadataOidIndexId, SYSCACHEID_INVALID, @@ -334,7 +334,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "operator class", + gettext_noop("operator class"), OperatorClassRelationId, OpclassOidIndexId, CLAOID, @@ -348,7 +348,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "operator", + gettext_noop("operator"), OperatorRelationId, OperatorOidIndexId, OPEROID, @@ -362,7 +362,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "operator family", + gettext_noop("operator family"), OperatorFamilyRelationId, OpfamilyOidIndexId, OPFAMILYOID, @@ -376,7 +376,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "property graph element", + gettext_noop("property graph element"), PropgraphElementRelationId, PropgraphElementObjectIndexId, PROPGRAPHELOID, @@ -390,7 +390,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph element label", + gettext_noop("property graph element label"), PropgraphElementLabelRelationId, PropgraphElementLabelObjectIndexId, -1, @@ -404,7 +404,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph label", + gettext_noop("property graph label"), PropgraphLabelRelationId, PropgraphLabelObjectIndexId, PROPGRAPHLABELOID, @@ -418,7 +418,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph label property", + gettext_noop("property graph label property"), PropgraphLabelPropertyRelationId, PropgraphLabelPropertyObjectIndexId, -1, @@ -432,7 +432,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph property", + gettext_noop("property graph property"), PropgraphPropertyRelationId, PropgraphPropertyObjectIndexId, -1, @@ -446,7 +446,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "role", + gettext_noop("role"), AuthIdRelationId, AuthIdOidIndexId, AUTHOID, @@ -460,7 +460,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "role membership", + gettext_noop("role membership"), AuthMemRelationId, AuthMemOidIndexId, SYSCACHEID_INVALID, @@ -474,7 +474,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "rule", + gettext_noop("rule"), RewriteRelationId, RewriteOidIndexId, SYSCACHEID_INVALID, @@ -488,7 +488,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "schema", + gettext_noop("schema"), NamespaceRelationId, NamespaceOidIndexId, NAMESPACEOID, @@ -502,7 +502,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "relation", + gettext_noop("relation"), RelationRelationId, ClassOidIndexId, RELOID, @@ -516,7 +516,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "tablespace", + gettext_noop("tablespace"), TableSpaceRelationId, TablespaceOidIndexId, TABLESPACEOID, @@ -530,7 +530,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "transform", + gettext_noop("transform"), TransformRelationId, TransformOidIndexId, TRFOID, @@ -544,7 +544,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "trigger", + gettext_noop("trigger"), TriggerRelationId, TriggerOidIndexId, SYSCACHEID_INVALID, @@ -558,7 +558,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "policy", + gettext_noop("policy"), PolicyRelationId, PolicyOidIndexId, SYSCACHEID_INVALID, @@ -572,7 +572,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "event trigger", + gettext_noop("event trigger"), EventTriggerRelationId, EventTriggerOidIndexId, EVENTTRIGGEROID, @@ -586,7 +586,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search configuration", + gettext_noop("text search configuration"), TSConfigRelationId, TSConfigOidIndexId, TSCONFIGOID, @@ -600,7 +600,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search dictionary", + gettext_noop("text search dictionary"), TSDictionaryRelationId, TSDictionaryOidIndexId, TSDICTOID, @@ -614,7 +614,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search parser", + gettext_noop("text search parser"), TSParserRelationId, TSParserOidIndexId, TSPARSEROID, @@ -628,7 +628,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search template", + gettext_noop("text search template"), TSTemplateRelationId, TSTemplateOidIndexId, TSTEMPLATEOID, @@ -642,7 +642,7 @@ static const ObjectPropertyType ObjectProperty[] = true, }, { - "type", + gettext_noop("type"), TypeRelationId, TypeOidIndexId, TYPEOID, @@ -656,7 +656,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "publication", + gettext_noop("publication"), PublicationRelationId, PublicationObjectIndexId, PUBLICATIONOID, @@ -670,7 +670,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "subscription", + gettext_noop("subscription"), SubscriptionRelationId, SubscriptionObjectIndexId, SUBSCRIPTIONOID, @@ -684,7 +684,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "extended statistics", + gettext_noop("extended statistics"), StatisticExtRelationId, StatisticExtOidIndexId, STATEXTOID, @@ -698,7 +698,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "user mapping", + gettext_noop("user mapping"), UserMappingRelationId, UserMappingOidIndexId, USERMAPPINGOID, diff --git a/src/backend/catalog/pg_depend.c b/src/backend/catalog/pg_depend.c index 9a7a401aced..0d28d34412d 100644 --- a/src/backend/catalog/pg_depend.c +++ b/src/backend/catalog/pg_depend.c @@ -810,7 +810,7 @@ dependencyLockAndCheckObject(Oid classId, Oid objectId) ereport(ERROR, (errcode(ERRCODE_UNDEFINED_OBJECT), errmsg("referenced %s was concurrently dropped", - get_object_class_descr(classId)))); + _(get_object_class_descr(classId))))); systable_endscan(scan); table_close(rel, AccessShareLock); -- 2.52.0 ----Next_Part(Fri_Jul__3_15_37_42_2026_665)---- ^ permalink raw reply [nested|flat] 34+ messages in thread
* [PATCH v1] Mark object class descriptions for translation @ 2026-07-03 06:06 Kyotaro Horiguchi <[email protected]> 0 siblings, 0 replies; 34+ messages in thread From: Kyotaro Horiguchi @ 2026-07-03 06:06 UTC (permalink / raw) ObjectPropertyType.class_descr was originally intended for internal error messages, but is now also used in a translated error message. Mark the object class descriptions for translation and translate the return value of get_object_class_descr(). --- src/backend/catalog/objectaddress.c | 88 ++++++++++++++--------------- src/backend/catalog/pg_depend.c | 2 +- 2 files changed, 45 insertions(+), 45 deletions(-) diff --git a/src/backend/catalog/objectaddress.c b/src/backend/catalog/objectaddress.c index af0e4703616..12dc76b712a 100644 --- a/src/backend/catalog/objectaddress.c +++ b/src/backend/catalog/objectaddress.c @@ -100,8 +100,8 @@ */ typedef struct { - const char *class_descr; /* string describing the catalog, for internal - * error messages */ + const char *class_descr; /* string describing the catalog, for error + * messages */ Oid class_oid; /* oid of catalog */ Oid oid_index_oid; /* oid of index on system oid column */ SysCacheIdentifier oid_catcache_id; /* id of catcache on system oid column */ @@ -124,7 +124,7 @@ typedef struct static const ObjectPropertyType ObjectProperty[] = { { - "access method", + gettext_noop("access method"), AccessMethodRelationId, AmOidIndexId, AMOID, @@ -138,7 +138,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "access method operator", + gettext_noop("access method operator"), AccessMethodOperatorRelationId, AccessMethodOperatorOidIndexId, SYSCACHEID_INVALID, @@ -152,7 +152,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "access method procedure", + gettext_noop("access method procedure"), AccessMethodProcedureRelationId, AccessMethodProcedureOidIndexId, SYSCACHEID_INVALID, @@ -166,7 +166,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "cast", + gettext_noop("cast"), CastRelationId, CastOidIndexId, SYSCACHEID_INVALID, @@ -180,7 +180,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "collation", + gettext_noop("collation"), CollationRelationId, CollationOidIndexId, COLLOID, @@ -194,7 +194,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "constraint", + gettext_noop("constraint"), ConstraintRelationId, ConstraintOidIndexId, CONSTROID, @@ -208,7 +208,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "conversion", + gettext_noop("conversion"), ConversionRelationId, ConversionOidIndexId, CONVOID, @@ -222,7 +222,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "database", + gettext_noop("database"), DatabaseRelationId, DatabaseOidIndexId, DATABASEOID, @@ -236,7 +236,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "default ACL", + gettext_noop("default ACL"), DefaultAclRelationId, DefaultAclOidIndexId, SYSCACHEID_INVALID, @@ -250,7 +250,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "extension", + gettext_noop("extension"), ExtensionRelationId, ExtensionOidIndexId, SYSCACHEID_INVALID, @@ -264,7 +264,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "foreign-data wrapper", + gettext_noop("foreign-data wrapper"), ForeignDataWrapperRelationId, ForeignDataWrapperOidIndexId, FOREIGNDATAWRAPPEROID, @@ -278,7 +278,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "foreign server", + gettext_noop("foreign server"), ForeignServerRelationId, ForeignServerOidIndexId, FOREIGNSERVEROID, @@ -292,7 +292,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "function", + gettext_noop("function"), ProcedureRelationId, ProcedureOidIndexId, PROCOID, @@ -306,7 +306,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "language", + gettext_noop("language"), LanguageRelationId, LanguageOidIndexId, LANGOID, @@ -320,7 +320,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "large object metadata", + gettext_noop("large object metadata"), LargeObjectMetadataRelationId, LargeObjectMetadataOidIndexId, SYSCACHEID_INVALID, @@ -334,7 +334,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "operator class", + gettext_noop("operator class"), OperatorClassRelationId, OpclassOidIndexId, CLAOID, @@ -348,7 +348,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "operator", + gettext_noop("operator"), OperatorRelationId, OperatorOidIndexId, OPEROID, @@ -362,7 +362,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "operator family", + gettext_noop("operator family"), OperatorFamilyRelationId, OpfamilyOidIndexId, OPFAMILYOID, @@ -376,7 +376,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "property graph element", + gettext_noop("property graph element"), PropgraphElementRelationId, PropgraphElementObjectIndexId, PROPGRAPHELOID, @@ -390,7 +390,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph element label", + gettext_noop("property graph element label"), PropgraphElementLabelRelationId, PropgraphElementLabelObjectIndexId, -1, @@ -404,7 +404,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph label", + gettext_noop("property graph label"), PropgraphLabelRelationId, PropgraphLabelObjectIndexId, PROPGRAPHLABELOID, @@ -418,7 +418,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph label property", + gettext_noop("property graph label property"), PropgraphLabelPropertyRelationId, PropgraphLabelPropertyObjectIndexId, -1, @@ -432,7 +432,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph property", + gettext_noop("property graph property"), PropgraphPropertyRelationId, PropgraphPropertyObjectIndexId, -1, @@ -446,7 +446,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "role", + gettext_noop("role"), AuthIdRelationId, AuthIdOidIndexId, AUTHOID, @@ -460,7 +460,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "role membership", + gettext_noop("role membership"), AuthMemRelationId, AuthMemOidIndexId, SYSCACHEID_INVALID, @@ -474,7 +474,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "rule", + gettext_noop("rule"), RewriteRelationId, RewriteOidIndexId, SYSCACHEID_INVALID, @@ -488,7 +488,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "schema", + gettext_noop("schema"), NamespaceRelationId, NamespaceOidIndexId, NAMESPACEOID, @@ -502,7 +502,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "relation", + gettext_noop("relation"), RelationRelationId, ClassOidIndexId, RELOID, @@ -516,7 +516,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "tablespace", + gettext_noop("tablespace"), TableSpaceRelationId, TablespaceOidIndexId, TABLESPACEOID, @@ -530,7 +530,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "transform", + gettext_noop("transform"), TransformRelationId, TransformOidIndexId, TRFOID, @@ -544,7 +544,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "trigger", + gettext_noop("trigger"), TriggerRelationId, TriggerOidIndexId, SYSCACHEID_INVALID, @@ -558,7 +558,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "policy", + gettext_noop("policy"), PolicyRelationId, PolicyOidIndexId, SYSCACHEID_INVALID, @@ -572,7 +572,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "event trigger", + gettext_noop("event trigger"), EventTriggerRelationId, EventTriggerOidIndexId, EVENTTRIGGEROID, @@ -586,7 +586,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search configuration", + gettext_noop("text search configuration"), TSConfigRelationId, TSConfigOidIndexId, TSCONFIGOID, @@ -600,7 +600,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search dictionary", + gettext_noop("text search dictionary"), TSDictionaryRelationId, TSDictionaryOidIndexId, TSDICTOID, @@ -614,7 +614,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search parser", + gettext_noop("text search parser"), TSParserRelationId, TSParserOidIndexId, TSPARSEROID, @@ -628,7 +628,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search template", + gettext_noop("text search template"), TSTemplateRelationId, TSTemplateOidIndexId, TSTEMPLATEOID, @@ -642,7 +642,7 @@ static const ObjectPropertyType ObjectProperty[] = true, }, { - "type", + gettext_noop("type"), TypeRelationId, TypeOidIndexId, TYPEOID, @@ -656,7 +656,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "publication", + gettext_noop("publication"), PublicationRelationId, PublicationObjectIndexId, PUBLICATIONOID, @@ -670,7 +670,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "subscription", + gettext_noop("subscription"), SubscriptionRelationId, SubscriptionObjectIndexId, SUBSCRIPTIONOID, @@ -684,7 +684,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "extended statistics", + gettext_noop("extended statistics"), StatisticExtRelationId, StatisticExtOidIndexId, STATEXTOID, @@ -698,7 +698,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "user mapping", + gettext_noop("user mapping"), UserMappingRelationId, UserMappingOidIndexId, USERMAPPINGOID, diff --git a/src/backend/catalog/pg_depend.c b/src/backend/catalog/pg_depend.c index 9a7a401aced..0d28d34412d 100644 --- a/src/backend/catalog/pg_depend.c +++ b/src/backend/catalog/pg_depend.c @@ -810,7 +810,7 @@ dependencyLockAndCheckObject(Oid classId, Oid objectId) ereport(ERROR, (errcode(ERRCODE_UNDEFINED_OBJECT), errmsg("referenced %s was concurrently dropped", - get_object_class_descr(classId)))); + _(get_object_class_descr(classId))))); systable_endscan(scan); table_close(rel, AccessShareLock); -- 2.52.0 ----Next_Part(Fri_Jul__3_15_37_42_2026_665)---- ^ permalink raw reply [nested|flat] 34+ messages in thread
* [PATCH v1] Mark object class descriptions for translation @ 2026-07-03 06:06 Kyotaro Horiguchi <[email protected]> 0 siblings, 0 replies; 34+ messages in thread From: Kyotaro Horiguchi @ 2026-07-03 06:06 UTC (permalink / raw) ObjectPropertyType.class_descr was originally intended for internal error messages, but is now also used in a translated error message. Mark the object class descriptions for translation and translate the return value of get_object_class_descr(). --- src/backend/catalog/objectaddress.c | 88 ++++++++++++++--------------- src/backend/catalog/pg_depend.c | 2 +- 2 files changed, 45 insertions(+), 45 deletions(-) diff --git a/src/backend/catalog/objectaddress.c b/src/backend/catalog/objectaddress.c index af0e4703616..12dc76b712a 100644 --- a/src/backend/catalog/objectaddress.c +++ b/src/backend/catalog/objectaddress.c @@ -100,8 +100,8 @@ */ typedef struct { - const char *class_descr; /* string describing the catalog, for internal - * error messages */ + const char *class_descr; /* string describing the catalog, for error + * messages */ Oid class_oid; /* oid of catalog */ Oid oid_index_oid; /* oid of index on system oid column */ SysCacheIdentifier oid_catcache_id; /* id of catcache on system oid column */ @@ -124,7 +124,7 @@ typedef struct static const ObjectPropertyType ObjectProperty[] = { { - "access method", + gettext_noop("access method"), AccessMethodRelationId, AmOidIndexId, AMOID, @@ -138,7 +138,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "access method operator", + gettext_noop("access method operator"), AccessMethodOperatorRelationId, AccessMethodOperatorOidIndexId, SYSCACHEID_INVALID, @@ -152,7 +152,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "access method procedure", + gettext_noop("access method procedure"), AccessMethodProcedureRelationId, AccessMethodProcedureOidIndexId, SYSCACHEID_INVALID, @@ -166,7 +166,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "cast", + gettext_noop("cast"), CastRelationId, CastOidIndexId, SYSCACHEID_INVALID, @@ -180,7 +180,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "collation", + gettext_noop("collation"), CollationRelationId, CollationOidIndexId, COLLOID, @@ -194,7 +194,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "constraint", + gettext_noop("constraint"), ConstraintRelationId, ConstraintOidIndexId, CONSTROID, @@ -208,7 +208,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "conversion", + gettext_noop("conversion"), ConversionRelationId, ConversionOidIndexId, CONVOID, @@ -222,7 +222,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "database", + gettext_noop("database"), DatabaseRelationId, DatabaseOidIndexId, DATABASEOID, @@ -236,7 +236,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "default ACL", + gettext_noop("default ACL"), DefaultAclRelationId, DefaultAclOidIndexId, SYSCACHEID_INVALID, @@ -250,7 +250,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "extension", + gettext_noop("extension"), ExtensionRelationId, ExtensionOidIndexId, SYSCACHEID_INVALID, @@ -264,7 +264,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "foreign-data wrapper", + gettext_noop("foreign-data wrapper"), ForeignDataWrapperRelationId, ForeignDataWrapperOidIndexId, FOREIGNDATAWRAPPEROID, @@ -278,7 +278,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "foreign server", + gettext_noop("foreign server"), ForeignServerRelationId, ForeignServerOidIndexId, FOREIGNSERVEROID, @@ -292,7 +292,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "function", + gettext_noop("function"), ProcedureRelationId, ProcedureOidIndexId, PROCOID, @@ -306,7 +306,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "language", + gettext_noop("language"), LanguageRelationId, LanguageOidIndexId, LANGOID, @@ -320,7 +320,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "large object metadata", + gettext_noop("large object metadata"), LargeObjectMetadataRelationId, LargeObjectMetadataOidIndexId, SYSCACHEID_INVALID, @@ -334,7 +334,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "operator class", + gettext_noop("operator class"), OperatorClassRelationId, OpclassOidIndexId, CLAOID, @@ -348,7 +348,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "operator", + gettext_noop("operator"), OperatorRelationId, OperatorOidIndexId, OPEROID, @@ -362,7 +362,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "operator family", + gettext_noop("operator family"), OperatorFamilyRelationId, OpfamilyOidIndexId, OPFAMILYOID, @@ -376,7 +376,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "property graph element", + gettext_noop("property graph element"), PropgraphElementRelationId, PropgraphElementObjectIndexId, PROPGRAPHELOID, @@ -390,7 +390,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph element label", + gettext_noop("property graph element label"), PropgraphElementLabelRelationId, PropgraphElementLabelObjectIndexId, -1, @@ -404,7 +404,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph label", + gettext_noop("property graph label"), PropgraphLabelRelationId, PropgraphLabelObjectIndexId, PROPGRAPHLABELOID, @@ -418,7 +418,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph label property", + gettext_noop("property graph label property"), PropgraphLabelPropertyRelationId, PropgraphLabelPropertyObjectIndexId, -1, @@ -432,7 +432,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph property", + gettext_noop("property graph property"), PropgraphPropertyRelationId, PropgraphPropertyObjectIndexId, -1, @@ -446,7 +446,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "role", + gettext_noop("role"), AuthIdRelationId, AuthIdOidIndexId, AUTHOID, @@ -460,7 +460,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "role membership", + gettext_noop("role membership"), AuthMemRelationId, AuthMemOidIndexId, SYSCACHEID_INVALID, @@ -474,7 +474,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "rule", + gettext_noop("rule"), RewriteRelationId, RewriteOidIndexId, SYSCACHEID_INVALID, @@ -488,7 +488,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "schema", + gettext_noop("schema"), NamespaceRelationId, NamespaceOidIndexId, NAMESPACEOID, @@ -502,7 +502,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "relation", + gettext_noop("relation"), RelationRelationId, ClassOidIndexId, RELOID, @@ -516,7 +516,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "tablespace", + gettext_noop("tablespace"), TableSpaceRelationId, TablespaceOidIndexId, TABLESPACEOID, @@ -530,7 +530,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "transform", + gettext_noop("transform"), TransformRelationId, TransformOidIndexId, TRFOID, @@ -544,7 +544,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "trigger", + gettext_noop("trigger"), TriggerRelationId, TriggerOidIndexId, SYSCACHEID_INVALID, @@ -558,7 +558,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "policy", + gettext_noop("policy"), PolicyRelationId, PolicyOidIndexId, SYSCACHEID_INVALID, @@ -572,7 +572,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "event trigger", + gettext_noop("event trigger"), EventTriggerRelationId, EventTriggerOidIndexId, EVENTTRIGGEROID, @@ -586,7 +586,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search configuration", + gettext_noop("text search configuration"), TSConfigRelationId, TSConfigOidIndexId, TSCONFIGOID, @@ -600,7 +600,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search dictionary", + gettext_noop("text search dictionary"), TSDictionaryRelationId, TSDictionaryOidIndexId, TSDICTOID, @@ -614,7 +614,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search parser", + gettext_noop("text search parser"), TSParserRelationId, TSParserOidIndexId, TSPARSEROID, @@ -628,7 +628,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search template", + gettext_noop("text search template"), TSTemplateRelationId, TSTemplateOidIndexId, TSTEMPLATEOID, @@ -642,7 +642,7 @@ static const ObjectPropertyType ObjectProperty[] = true, }, { - "type", + gettext_noop("type"), TypeRelationId, TypeOidIndexId, TYPEOID, @@ -656,7 +656,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "publication", + gettext_noop("publication"), PublicationRelationId, PublicationObjectIndexId, PUBLICATIONOID, @@ -670,7 +670,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "subscription", + gettext_noop("subscription"), SubscriptionRelationId, SubscriptionObjectIndexId, SUBSCRIPTIONOID, @@ -684,7 +684,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "extended statistics", + gettext_noop("extended statistics"), StatisticExtRelationId, StatisticExtOidIndexId, STATEXTOID, @@ -698,7 +698,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "user mapping", + gettext_noop("user mapping"), UserMappingRelationId, UserMappingOidIndexId, USERMAPPINGOID, diff --git a/src/backend/catalog/pg_depend.c b/src/backend/catalog/pg_depend.c index 9a7a401aced..0d28d34412d 100644 --- a/src/backend/catalog/pg_depend.c +++ b/src/backend/catalog/pg_depend.c @@ -810,7 +810,7 @@ dependencyLockAndCheckObject(Oid classId, Oid objectId) ereport(ERROR, (errcode(ERRCODE_UNDEFINED_OBJECT), errmsg("referenced %s was concurrently dropped", - get_object_class_descr(classId)))); + _(get_object_class_descr(classId))))); systable_endscan(scan); table_close(rel, AccessShareLock); -- 2.52.0 ----Next_Part(Fri_Jul__3_15_37_42_2026_665)---- ^ permalink raw reply [nested|flat] 34+ messages in thread
* [PATCH v1] Mark object class descriptions for translation @ 2026-07-03 06:06 Kyotaro Horiguchi <[email protected]> 0 siblings, 0 replies; 34+ messages in thread From: Kyotaro Horiguchi @ 2026-07-03 06:06 UTC (permalink / raw) ObjectPropertyType.class_descr was originally intended for internal error messages, but is now also used in a translated error message. Mark the object class descriptions for translation and translate the return value of get_object_class_descr(). --- src/backend/catalog/objectaddress.c | 88 ++++++++++++++--------------- src/backend/catalog/pg_depend.c | 2 +- 2 files changed, 45 insertions(+), 45 deletions(-) diff --git a/src/backend/catalog/objectaddress.c b/src/backend/catalog/objectaddress.c index af0e4703616..12dc76b712a 100644 --- a/src/backend/catalog/objectaddress.c +++ b/src/backend/catalog/objectaddress.c @@ -100,8 +100,8 @@ */ typedef struct { - const char *class_descr; /* string describing the catalog, for internal - * error messages */ + const char *class_descr; /* string describing the catalog, for error + * messages */ Oid class_oid; /* oid of catalog */ Oid oid_index_oid; /* oid of index on system oid column */ SysCacheIdentifier oid_catcache_id; /* id of catcache on system oid column */ @@ -124,7 +124,7 @@ typedef struct static const ObjectPropertyType ObjectProperty[] = { { - "access method", + gettext_noop("access method"), AccessMethodRelationId, AmOidIndexId, AMOID, @@ -138,7 +138,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "access method operator", + gettext_noop("access method operator"), AccessMethodOperatorRelationId, AccessMethodOperatorOidIndexId, SYSCACHEID_INVALID, @@ -152,7 +152,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "access method procedure", + gettext_noop("access method procedure"), AccessMethodProcedureRelationId, AccessMethodProcedureOidIndexId, SYSCACHEID_INVALID, @@ -166,7 +166,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "cast", + gettext_noop("cast"), CastRelationId, CastOidIndexId, SYSCACHEID_INVALID, @@ -180,7 +180,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "collation", + gettext_noop("collation"), CollationRelationId, CollationOidIndexId, COLLOID, @@ -194,7 +194,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "constraint", + gettext_noop("constraint"), ConstraintRelationId, ConstraintOidIndexId, CONSTROID, @@ -208,7 +208,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "conversion", + gettext_noop("conversion"), ConversionRelationId, ConversionOidIndexId, CONVOID, @@ -222,7 +222,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "database", + gettext_noop("database"), DatabaseRelationId, DatabaseOidIndexId, DATABASEOID, @@ -236,7 +236,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "default ACL", + gettext_noop("default ACL"), DefaultAclRelationId, DefaultAclOidIndexId, SYSCACHEID_INVALID, @@ -250,7 +250,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "extension", + gettext_noop("extension"), ExtensionRelationId, ExtensionOidIndexId, SYSCACHEID_INVALID, @@ -264,7 +264,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "foreign-data wrapper", + gettext_noop("foreign-data wrapper"), ForeignDataWrapperRelationId, ForeignDataWrapperOidIndexId, FOREIGNDATAWRAPPEROID, @@ -278,7 +278,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "foreign server", + gettext_noop("foreign server"), ForeignServerRelationId, ForeignServerOidIndexId, FOREIGNSERVEROID, @@ -292,7 +292,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "function", + gettext_noop("function"), ProcedureRelationId, ProcedureOidIndexId, PROCOID, @@ -306,7 +306,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "language", + gettext_noop("language"), LanguageRelationId, LanguageOidIndexId, LANGOID, @@ -320,7 +320,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "large object metadata", + gettext_noop("large object metadata"), LargeObjectMetadataRelationId, LargeObjectMetadataOidIndexId, SYSCACHEID_INVALID, @@ -334,7 +334,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "operator class", + gettext_noop("operator class"), OperatorClassRelationId, OpclassOidIndexId, CLAOID, @@ -348,7 +348,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "operator", + gettext_noop("operator"), OperatorRelationId, OperatorOidIndexId, OPEROID, @@ -362,7 +362,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "operator family", + gettext_noop("operator family"), OperatorFamilyRelationId, OpfamilyOidIndexId, OPFAMILYOID, @@ -376,7 +376,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "property graph element", + gettext_noop("property graph element"), PropgraphElementRelationId, PropgraphElementObjectIndexId, PROPGRAPHELOID, @@ -390,7 +390,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph element label", + gettext_noop("property graph element label"), PropgraphElementLabelRelationId, PropgraphElementLabelObjectIndexId, -1, @@ -404,7 +404,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph label", + gettext_noop("property graph label"), PropgraphLabelRelationId, PropgraphLabelObjectIndexId, PROPGRAPHLABELOID, @@ -418,7 +418,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph label property", + gettext_noop("property graph label property"), PropgraphLabelPropertyRelationId, PropgraphLabelPropertyObjectIndexId, -1, @@ -432,7 +432,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph property", + gettext_noop("property graph property"), PropgraphPropertyRelationId, PropgraphPropertyObjectIndexId, -1, @@ -446,7 +446,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "role", + gettext_noop("role"), AuthIdRelationId, AuthIdOidIndexId, AUTHOID, @@ -460,7 +460,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "role membership", + gettext_noop("role membership"), AuthMemRelationId, AuthMemOidIndexId, SYSCACHEID_INVALID, @@ -474,7 +474,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "rule", + gettext_noop("rule"), RewriteRelationId, RewriteOidIndexId, SYSCACHEID_INVALID, @@ -488,7 +488,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "schema", + gettext_noop("schema"), NamespaceRelationId, NamespaceOidIndexId, NAMESPACEOID, @@ -502,7 +502,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "relation", + gettext_noop("relation"), RelationRelationId, ClassOidIndexId, RELOID, @@ -516,7 +516,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "tablespace", + gettext_noop("tablespace"), TableSpaceRelationId, TablespaceOidIndexId, TABLESPACEOID, @@ -530,7 +530,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "transform", + gettext_noop("transform"), TransformRelationId, TransformOidIndexId, TRFOID, @@ -544,7 +544,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "trigger", + gettext_noop("trigger"), TriggerRelationId, TriggerOidIndexId, SYSCACHEID_INVALID, @@ -558,7 +558,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "policy", + gettext_noop("policy"), PolicyRelationId, PolicyOidIndexId, SYSCACHEID_INVALID, @@ -572,7 +572,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "event trigger", + gettext_noop("event trigger"), EventTriggerRelationId, EventTriggerOidIndexId, EVENTTRIGGEROID, @@ -586,7 +586,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search configuration", + gettext_noop("text search configuration"), TSConfigRelationId, TSConfigOidIndexId, TSCONFIGOID, @@ -600,7 +600,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search dictionary", + gettext_noop("text search dictionary"), TSDictionaryRelationId, TSDictionaryOidIndexId, TSDICTOID, @@ -614,7 +614,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search parser", + gettext_noop("text search parser"), TSParserRelationId, TSParserOidIndexId, TSPARSEROID, @@ -628,7 +628,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search template", + gettext_noop("text search template"), TSTemplateRelationId, TSTemplateOidIndexId, TSTEMPLATEOID, @@ -642,7 +642,7 @@ static const ObjectPropertyType ObjectProperty[] = true, }, { - "type", + gettext_noop("type"), TypeRelationId, TypeOidIndexId, TYPEOID, @@ -656,7 +656,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "publication", + gettext_noop("publication"), PublicationRelationId, PublicationObjectIndexId, PUBLICATIONOID, @@ -670,7 +670,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "subscription", + gettext_noop("subscription"), SubscriptionRelationId, SubscriptionObjectIndexId, SUBSCRIPTIONOID, @@ -684,7 +684,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "extended statistics", + gettext_noop("extended statistics"), StatisticExtRelationId, StatisticExtOidIndexId, STATEXTOID, @@ -698,7 +698,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "user mapping", + gettext_noop("user mapping"), UserMappingRelationId, UserMappingOidIndexId, USERMAPPINGOID, diff --git a/src/backend/catalog/pg_depend.c b/src/backend/catalog/pg_depend.c index 9a7a401aced..0d28d34412d 100644 --- a/src/backend/catalog/pg_depend.c +++ b/src/backend/catalog/pg_depend.c @@ -810,7 +810,7 @@ dependencyLockAndCheckObject(Oid classId, Oid objectId) ereport(ERROR, (errcode(ERRCODE_UNDEFINED_OBJECT), errmsg("referenced %s was concurrently dropped", - get_object_class_descr(classId)))); + _(get_object_class_descr(classId))))); systable_endscan(scan); table_close(rel, AccessShareLock); -- 2.52.0 ----Next_Part(Fri_Jul__3_15_37_42_2026_665)---- ^ permalink raw reply [nested|flat] 34+ messages in thread
* [PATCH v1] Mark object class descriptions for translation @ 2026-07-03 06:06 Kyotaro Horiguchi <[email protected]> 0 siblings, 0 replies; 34+ messages in thread From: Kyotaro Horiguchi @ 2026-07-03 06:06 UTC (permalink / raw) ObjectPropertyType.class_descr was originally intended for internal error messages, but is now also used in a translated error message. Mark the object class descriptions for translation and translate the return value of get_object_class_descr(). --- src/backend/catalog/objectaddress.c | 88 ++++++++++++++--------------- src/backend/catalog/pg_depend.c | 2 +- 2 files changed, 45 insertions(+), 45 deletions(-) diff --git a/src/backend/catalog/objectaddress.c b/src/backend/catalog/objectaddress.c index af0e4703616..12dc76b712a 100644 --- a/src/backend/catalog/objectaddress.c +++ b/src/backend/catalog/objectaddress.c @@ -100,8 +100,8 @@ */ typedef struct { - const char *class_descr; /* string describing the catalog, for internal - * error messages */ + const char *class_descr; /* string describing the catalog, for error + * messages */ Oid class_oid; /* oid of catalog */ Oid oid_index_oid; /* oid of index on system oid column */ SysCacheIdentifier oid_catcache_id; /* id of catcache on system oid column */ @@ -124,7 +124,7 @@ typedef struct static const ObjectPropertyType ObjectProperty[] = { { - "access method", + gettext_noop("access method"), AccessMethodRelationId, AmOidIndexId, AMOID, @@ -138,7 +138,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "access method operator", + gettext_noop("access method operator"), AccessMethodOperatorRelationId, AccessMethodOperatorOidIndexId, SYSCACHEID_INVALID, @@ -152,7 +152,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "access method procedure", + gettext_noop("access method procedure"), AccessMethodProcedureRelationId, AccessMethodProcedureOidIndexId, SYSCACHEID_INVALID, @@ -166,7 +166,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "cast", + gettext_noop("cast"), CastRelationId, CastOidIndexId, SYSCACHEID_INVALID, @@ -180,7 +180,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "collation", + gettext_noop("collation"), CollationRelationId, CollationOidIndexId, COLLOID, @@ -194,7 +194,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "constraint", + gettext_noop("constraint"), ConstraintRelationId, ConstraintOidIndexId, CONSTROID, @@ -208,7 +208,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "conversion", + gettext_noop("conversion"), ConversionRelationId, ConversionOidIndexId, CONVOID, @@ -222,7 +222,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "database", + gettext_noop("database"), DatabaseRelationId, DatabaseOidIndexId, DATABASEOID, @@ -236,7 +236,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "default ACL", + gettext_noop("default ACL"), DefaultAclRelationId, DefaultAclOidIndexId, SYSCACHEID_INVALID, @@ -250,7 +250,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "extension", + gettext_noop("extension"), ExtensionRelationId, ExtensionOidIndexId, SYSCACHEID_INVALID, @@ -264,7 +264,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "foreign-data wrapper", + gettext_noop("foreign-data wrapper"), ForeignDataWrapperRelationId, ForeignDataWrapperOidIndexId, FOREIGNDATAWRAPPEROID, @@ -278,7 +278,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "foreign server", + gettext_noop("foreign server"), ForeignServerRelationId, ForeignServerOidIndexId, FOREIGNSERVEROID, @@ -292,7 +292,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "function", + gettext_noop("function"), ProcedureRelationId, ProcedureOidIndexId, PROCOID, @@ -306,7 +306,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "language", + gettext_noop("language"), LanguageRelationId, LanguageOidIndexId, LANGOID, @@ -320,7 +320,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "large object metadata", + gettext_noop("large object metadata"), LargeObjectMetadataRelationId, LargeObjectMetadataOidIndexId, SYSCACHEID_INVALID, @@ -334,7 +334,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "operator class", + gettext_noop("operator class"), OperatorClassRelationId, OpclassOidIndexId, CLAOID, @@ -348,7 +348,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "operator", + gettext_noop("operator"), OperatorRelationId, OperatorOidIndexId, OPEROID, @@ -362,7 +362,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "operator family", + gettext_noop("operator family"), OperatorFamilyRelationId, OpfamilyOidIndexId, OPFAMILYOID, @@ -376,7 +376,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "property graph element", + gettext_noop("property graph element"), PropgraphElementRelationId, PropgraphElementObjectIndexId, PROPGRAPHELOID, @@ -390,7 +390,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph element label", + gettext_noop("property graph element label"), PropgraphElementLabelRelationId, PropgraphElementLabelObjectIndexId, -1, @@ -404,7 +404,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph label", + gettext_noop("property graph label"), PropgraphLabelRelationId, PropgraphLabelObjectIndexId, PROPGRAPHLABELOID, @@ -418,7 +418,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph label property", + gettext_noop("property graph label property"), PropgraphLabelPropertyRelationId, PropgraphLabelPropertyObjectIndexId, -1, @@ -432,7 +432,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph property", + gettext_noop("property graph property"), PropgraphPropertyRelationId, PropgraphPropertyObjectIndexId, -1, @@ -446,7 +446,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "role", + gettext_noop("role"), AuthIdRelationId, AuthIdOidIndexId, AUTHOID, @@ -460,7 +460,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "role membership", + gettext_noop("role membership"), AuthMemRelationId, AuthMemOidIndexId, SYSCACHEID_INVALID, @@ -474,7 +474,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "rule", + gettext_noop("rule"), RewriteRelationId, RewriteOidIndexId, SYSCACHEID_INVALID, @@ -488,7 +488,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "schema", + gettext_noop("schema"), NamespaceRelationId, NamespaceOidIndexId, NAMESPACEOID, @@ -502,7 +502,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "relation", + gettext_noop("relation"), RelationRelationId, ClassOidIndexId, RELOID, @@ -516,7 +516,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "tablespace", + gettext_noop("tablespace"), TableSpaceRelationId, TablespaceOidIndexId, TABLESPACEOID, @@ -530,7 +530,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "transform", + gettext_noop("transform"), TransformRelationId, TransformOidIndexId, TRFOID, @@ -544,7 +544,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "trigger", + gettext_noop("trigger"), TriggerRelationId, TriggerOidIndexId, SYSCACHEID_INVALID, @@ -558,7 +558,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "policy", + gettext_noop("policy"), PolicyRelationId, PolicyOidIndexId, SYSCACHEID_INVALID, @@ -572,7 +572,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "event trigger", + gettext_noop("event trigger"), EventTriggerRelationId, EventTriggerOidIndexId, EVENTTRIGGEROID, @@ -586,7 +586,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search configuration", + gettext_noop("text search configuration"), TSConfigRelationId, TSConfigOidIndexId, TSCONFIGOID, @@ -600,7 +600,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search dictionary", + gettext_noop("text search dictionary"), TSDictionaryRelationId, TSDictionaryOidIndexId, TSDICTOID, @@ -614,7 +614,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search parser", + gettext_noop("text search parser"), TSParserRelationId, TSParserOidIndexId, TSPARSEROID, @@ -628,7 +628,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search template", + gettext_noop("text search template"), TSTemplateRelationId, TSTemplateOidIndexId, TSTEMPLATEOID, @@ -642,7 +642,7 @@ static const ObjectPropertyType ObjectProperty[] = true, }, { - "type", + gettext_noop("type"), TypeRelationId, TypeOidIndexId, TYPEOID, @@ -656,7 +656,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "publication", + gettext_noop("publication"), PublicationRelationId, PublicationObjectIndexId, PUBLICATIONOID, @@ -670,7 +670,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "subscription", + gettext_noop("subscription"), SubscriptionRelationId, SubscriptionObjectIndexId, SUBSCRIPTIONOID, @@ -684,7 +684,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "extended statistics", + gettext_noop("extended statistics"), StatisticExtRelationId, StatisticExtOidIndexId, STATEXTOID, @@ -698,7 +698,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "user mapping", + gettext_noop("user mapping"), UserMappingRelationId, UserMappingOidIndexId, USERMAPPINGOID, diff --git a/src/backend/catalog/pg_depend.c b/src/backend/catalog/pg_depend.c index 9a7a401aced..0d28d34412d 100644 --- a/src/backend/catalog/pg_depend.c +++ b/src/backend/catalog/pg_depend.c @@ -810,7 +810,7 @@ dependencyLockAndCheckObject(Oid classId, Oid objectId) ereport(ERROR, (errcode(ERRCODE_UNDEFINED_OBJECT), errmsg("referenced %s was concurrently dropped", - get_object_class_descr(classId)))); + _(get_object_class_descr(classId))))); systable_endscan(scan); table_close(rel, AccessShareLock); -- 2.52.0 ----Next_Part(Fri_Jul__3_15_37_42_2026_665)---- ^ permalink raw reply [nested|flat] 34+ messages in thread
* [PATCH v1] Mark object class descriptions for translation @ 2026-07-03 06:06 Kyotaro Horiguchi <[email protected]> 0 siblings, 0 replies; 34+ messages in thread From: Kyotaro Horiguchi @ 2026-07-03 06:06 UTC (permalink / raw) ObjectPropertyType.class_descr was originally intended for internal error messages, but is now also used in a translated error message. Mark the object class descriptions for translation and translate the return value of get_object_class_descr(). --- src/backend/catalog/objectaddress.c | 88 ++++++++++++++--------------- src/backend/catalog/pg_depend.c | 2 +- 2 files changed, 45 insertions(+), 45 deletions(-) diff --git a/src/backend/catalog/objectaddress.c b/src/backend/catalog/objectaddress.c index af0e4703616..12dc76b712a 100644 --- a/src/backend/catalog/objectaddress.c +++ b/src/backend/catalog/objectaddress.c @@ -100,8 +100,8 @@ */ typedef struct { - const char *class_descr; /* string describing the catalog, for internal - * error messages */ + const char *class_descr; /* string describing the catalog, for error + * messages */ Oid class_oid; /* oid of catalog */ Oid oid_index_oid; /* oid of index on system oid column */ SysCacheIdentifier oid_catcache_id; /* id of catcache on system oid column */ @@ -124,7 +124,7 @@ typedef struct static const ObjectPropertyType ObjectProperty[] = { { - "access method", + gettext_noop("access method"), AccessMethodRelationId, AmOidIndexId, AMOID, @@ -138,7 +138,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "access method operator", + gettext_noop("access method operator"), AccessMethodOperatorRelationId, AccessMethodOperatorOidIndexId, SYSCACHEID_INVALID, @@ -152,7 +152,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "access method procedure", + gettext_noop("access method procedure"), AccessMethodProcedureRelationId, AccessMethodProcedureOidIndexId, SYSCACHEID_INVALID, @@ -166,7 +166,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "cast", + gettext_noop("cast"), CastRelationId, CastOidIndexId, SYSCACHEID_INVALID, @@ -180,7 +180,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "collation", + gettext_noop("collation"), CollationRelationId, CollationOidIndexId, COLLOID, @@ -194,7 +194,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "constraint", + gettext_noop("constraint"), ConstraintRelationId, ConstraintOidIndexId, CONSTROID, @@ -208,7 +208,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "conversion", + gettext_noop("conversion"), ConversionRelationId, ConversionOidIndexId, CONVOID, @@ -222,7 +222,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "database", + gettext_noop("database"), DatabaseRelationId, DatabaseOidIndexId, DATABASEOID, @@ -236,7 +236,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "default ACL", + gettext_noop("default ACL"), DefaultAclRelationId, DefaultAclOidIndexId, SYSCACHEID_INVALID, @@ -250,7 +250,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "extension", + gettext_noop("extension"), ExtensionRelationId, ExtensionOidIndexId, SYSCACHEID_INVALID, @@ -264,7 +264,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "foreign-data wrapper", + gettext_noop("foreign-data wrapper"), ForeignDataWrapperRelationId, ForeignDataWrapperOidIndexId, FOREIGNDATAWRAPPEROID, @@ -278,7 +278,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "foreign server", + gettext_noop("foreign server"), ForeignServerRelationId, ForeignServerOidIndexId, FOREIGNSERVEROID, @@ -292,7 +292,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "function", + gettext_noop("function"), ProcedureRelationId, ProcedureOidIndexId, PROCOID, @@ -306,7 +306,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "language", + gettext_noop("language"), LanguageRelationId, LanguageOidIndexId, LANGOID, @@ -320,7 +320,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "large object metadata", + gettext_noop("large object metadata"), LargeObjectMetadataRelationId, LargeObjectMetadataOidIndexId, SYSCACHEID_INVALID, @@ -334,7 +334,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "operator class", + gettext_noop("operator class"), OperatorClassRelationId, OpclassOidIndexId, CLAOID, @@ -348,7 +348,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "operator", + gettext_noop("operator"), OperatorRelationId, OperatorOidIndexId, OPEROID, @@ -362,7 +362,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "operator family", + gettext_noop("operator family"), OperatorFamilyRelationId, OpfamilyOidIndexId, OPFAMILYOID, @@ -376,7 +376,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "property graph element", + gettext_noop("property graph element"), PropgraphElementRelationId, PropgraphElementObjectIndexId, PROPGRAPHELOID, @@ -390,7 +390,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph element label", + gettext_noop("property graph element label"), PropgraphElementLabelRelationId, PropgraphElementLabelObjectIndexId, -1, @@ -404,7 +404,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph label", + gettext_noop("property graph label"), PropgraphLabelRelationId, PropgraphLabelObjectIndexId, PROPGRAPHLABELOID, @@ -418,7 +418,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph label property", + gettext_noop("property graph label property"), PropgraphLabelPropertyRelationId, PropgraphLabelPropertyObjectIndexId, -1, @@ -432,7 +432,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph property", + gettext_noop("property graph property"), PropgraphPropertyRelationId, PropgraphPropertyObjectIndexId, -1, @@ -446,7 +446,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "role", + gettext_noop("role"), AuthIdRelationId, AuthIdOidIndexId, AUTHOID, @@ -460,7 +460,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "role membership", + gettext_noop("role membership"), AuthMemRelationId, AuthMemOidIndexId, SYSCACHEID_INVALID, @@ -474,7 +474,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "rule", + gettext_noop("rule"), RewriteRelationId, RewriteOidIndexId, SYSCACHEID_INVALID, @@ -488,7 +488,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "schema", + gettext_noop("schema"), NamespaceRelationId, NamespaceOidIndexId, NAMESPACEOID, @@ -502,7 +502,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "relation", + gettext_noop("relation"), RelationRelationId, ClassOidIndexId, RELOID, @@ -516,7 +516,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "tablespace", + gettext_noop("tablespace"), TableSpaceRelationId, TablespaceOidIndexId, TABLESPACEOID, @@ -530,7 +530,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "transform", + gettext_noop("transform"), TransformRelationId, TransformOidIndexId, TRFOID, @@ -544,7 +544,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "trigger", + gettext_noop("trigger"), TriggerRelationId, TriggerOidIndexId, SYSCACHEID_INVALID, @@ -558,7 +558,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "policy", + gettext_noop("policy"), PolicyRelationId, PolicyOidIndexId, SYSCACHEID_INVALID, @@ -572,7 +572,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "event trigger", + gettext_noop("event trigger"), EventTriggerRelationId, EventTriggerOidIndexId, EVENTTRIGGEROID, @@ -586,7 +586,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search configuration", + gettext_noop("text search configuration"), TSConfigRelationId, TSConfigOidIndexId, TSCONFIGOID, @@ -600,7 +600,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search dictionary", + gettext_noop("text search dictionary"), TSDictionaryRelationId, TSDictionaryOidIndexId, TSDICTOID, @@ -614,7 +614,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search parser", + gettext_noop("text search parser"), TSParserRelationId, TSParserOidIndexId, TSPARSEROID, @@ -628,7 +628,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search template", + gettext_noop("text search template"), TSTemplateRelationId, TSTemplateOidIndexId, TSTEMPLATEOID, @@ -642,7 +642,7 @@ static const ObjectPropertyType ObjectProperty[] = true, }, { - "type", + gettext_noop("type"), TypeRelationId, TypeOidIndexId, TYPEOID, @@ -656,7 +656,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "publication", + gettext_noop("publication"), PublicationRelationId, PublicationObjectIndexId, PUBLICATIONOID, @@ -670,7 +670,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "subscription", + gettext_noop("subscription"), SubscriptionRelationId, SubscriptionObjectIndexId, SUBSCRIPTIONOID, @@ -684,7 +684,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "extended statistics", + gettext_noop("extended statistics"), StatisticExtRelationId, StatisticExtOidIndexId, STATEXTOID, @@ -698,7 +698,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "user mapping", + gettext_noop("user mapping"), UserMappingRelationId, UserMappingOidIndexId, USERMAPPINGOID, diff --git a/src/backend/catalog/pg_depend.c b/src/backend/catalog/pg_depend.c index 9a7a401aced..0d28d34412d 100644 --- a/src/backend/catalog/pg_depend.c +++ b/src/backend/catalog/pg_depend.c @@ -810,7 +810,7 @@ dependencyLockAndCheckObject(Oid classId, Oid objectId) ereport(ERROR, (errcode(ERRCODE_UNDEFINED_OBJECT), errmsg("referenced %s was concurrently dropped", - get_object_class_descr(classId)))); + _(get_object_class_descr(classId))))); systable_endscan(scan); table_close(rel, AccessShareLock); -- 2.52.0 ----Next_Part(Fri_Jul__3_15_37_42_2026_665)---- ^ permalink raw reply [nested|flat] 34+ messages in thread
* [PATCH v1] Mark object class descriptions for translation @ 2026-07-03 06:06 Kyotaro Horiguchi <[email protected]> 0 siblings, 0 replies; 34+ messages in thread From: Kyotaro Horiguchi @ 2026-07-03 06:06 UTC (permalink / raw) ObjectPropertyType.class_descr was originally intended for internal error messages, but is now also used in a translated error message. Mark the object class descriptions for translation and translate the return value of get_object_class_descr(). --- src/backend/catalog/objectaddress.c | 88 ++++++++++++++--------------- src/backend/catalog/pg_depend.c | 2 +- 2 files changed, 45 insertions(+), 45 deletions(-) diff --git a/src/backend/catalog/objectaddress.c b/src/backend/catalog/objectaddress.c index af0e4703616..12dc76b712a 100644 --- a/src/backend/catalog/objectaddress.c +++ b/src/backend/catalog/objectaddress.c @@ -100,8 +100,8 @@ */ typedef struct { - const char *class_descr; /* string describing the catalog, for internal - * error messages */ + const char *class_descr; /* string describing the catalog, for error + * messages */ Oid class_oid; /* oid of catalog */ Oid oid_index_oid; /* oid of index on system oid column */ SysCacheIdentifier oid_catcache_id; /* id of catcache on system oid column */ @@ -124,7 +124,7 @@ typedef struct static const ObjectPropertyType ObjectProperty[] = { { - "access method", + gettext_noop("access method"), AccessMethodRelationId, AmOidIndexId, AMOID, @@ -138,7 +138,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "access method operator", + gettext_noop("access method operator"), AccessMethodOperatorRelationId, AccessMethodOperatorOidIndexId, SYSCACHEID_INVALID, @@ -152,7 +152,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "access method procedure", + gettext_noop("access method procedure"), AccessMethodProcedureRelationId, AccessMethodProcedureOidIndexId, SYSCACHEID_INVALID, @@ -166,7 +166,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "cast", + gettext_noop("cast"), CastRelationId, CastOidIndexId, SYSCACHEID_INVALID, @@ -180,7 +180,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "collation", + gettext_noop("collation"), CollationRelationId, CollationOidIndexId, COLLOID, @@ -194,7 +194,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "constraint", + gettext_noop("constraint"), ConstraintRelationId, ConstraintOidIndexId, CONSTROID, @@ -208,7 +208,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "conversion", + gettext_noop("conversion"), ConversionRelationId, ConversionOidIndexId, CONVOID, @@ -222,7 +222,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "database", + gettext_noop("database"), DatabaseRelationId, DatabaseOidIndexId, DATABASEOID, @@ -236,7 +236,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "default ACL", + gettext_noop("default ACL"), DefaultAclRelationId, DefaultAclOidIndexId, SYSCACHEID_INVALID, @@ -250,7 +250,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "extension", + gettext_noop("extension"), ExtensionRelationId, ExtensionOidIndexId, SYSCACHEID_INVALID, @@ -264,7 +264,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "foreign-data wrapper", + gettext_noop("foreign-data wrapper"), ForeignDataWrapperRelationId, ForeignDataWrapperOidIndexId, FOREIGNDATAWRAPPEROID, @@ -278,7 +278,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "foreign server", + gettext_noop("foreign server"), ForeignServerRelationId, ForeignServerOidIndexId, FOREIGNSERVEROID, @@ -292,7 +292,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "function", + gettext_noop("function"), ProcedureRelationId, ProcedureOidIndexId, PROCOID, @@ -306,7 +306,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "language", + gettext_noop("language"), LanguageRelationId, LanguageOidIndexId, LANGOID, @@ -320,7 +320,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "large object metadata", + gettext_noop("large object metadata"), LargeObjectMetadataRelationId, LargeObjectMetadataOidIndexId, SYSCACHEID_INVALID, @@ -334,7 +334,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "operator class", + gettext_noop("operator class"), OperatorClassRelationId, OpclassOidIndexId, CLAOID, @@ -348,7 +348,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "operator", + gettext_noop("operator"), OperatorRelationId, OperatorOidIndexId, OPEROID, @@ -362,7 +362,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "operator family", + gettext_noop("operator family"), OperatorFamilyRelationId, OpfamilyOidIndexId, OPFAMILYOID, @@ -376,7 +376,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "property graph element", + gettext_noop("property graph element"), PropgraphElementRelationId, PropgraphElementObjectIndexId, PROPGRAPHELOID, @@ -390,7 +390,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph element label", + gettext_noop("property graph element label"), PropgraphElementLabelRelationId, PropgraphElementLabelObjectIndexId, -1, @@ -404,7 +404,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph label", + gettext_noop("property graph label"), PropgraphLabelRelationId, PropgraphLabelObjectIndexId, PROPGRAPHLABELOID, @@ -418,7 +418,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph label property", + gettext_noop("property graph label property"), PropgraphLabelPropertyRelationId, PropgraphLabelPropertyObjectIndexId, -1, @@ -432,7 +432,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph property", + gettext_noop("property graph property"), PropgraphPropertyRelationId, PropgraphPropertyObjectIndexId, -1, @@ -446,7 +446,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "role", + gettext_noop("role"), AuthIdRelationId, AuthIdOidIndexId, AUTHOID, @@ -460,7 +460,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "role membership", + gettext_noop("role membership"), AuthMemRelationId, AuthMemOidIndexId, SYSCACHEID_INVALID, @@ -474,7 +474,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "rule", + gettext_noop("rule"), RewriteRelationId, RewriteOidIndexId, SYSCACHEID_INVALID, @@ -488,7 +488,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "schema", + gettext_noop("schema"), NamespaceRelationId, NamespaceOidIndexId, NAMESPACEOID, @@ -502,7 +502,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "relation", + gettext_noop("relation"), RelationRelationId, ClassOidIndexId, RELOID, @@ -516,7 +516,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "tablespace", + gettext_noop("tablespace"), TableSpaceRelationId, TablespaceOidIndexId, TABLESPACEOID, @@ -530,7 +530,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "transform", + gettext_noop("transform"), TransformRelationId, TransformOidIndexId, TRFOID, @@ -544,7 +544,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "trigger", + gettext_noop("trigger"), TriggerRelationId, TriggerOidIndexId, SYSCACHEID_INVALID, @@ -558,7 +558,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "policy", + gettext_noop("policy"), PolicyRelationId, PolicyOidIndexId, SYSCACHEID_INVALID, @@ -572,7 +572,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "event trigger", + gettext_noop("event trigger"), EventTriggerRelationId, EventTriggerOidIndexId, EVENTTRIGGEROID, @@ -586,7 +586,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search configuration", + gettext_noop("text search configuration"), TSConfigRelationId, TSConfigOidIndexId, TSCONFIGOID, @@ -600,7 +600,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search dictionary", + gettext_noop("text search dictionary"), TSDictionaryRelationId, TSDictionaryOidIndexId, TSDICTOID, @@ -614,7 +614,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search parser", + gettext_noop("text search parser"), TSParserRelationId, TSParserOidIndexId, TSPARSEROID, @@ -628,7 +628,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search template", + gettext_noop("text search template"), TSTemplateRelationId, TSTemplateOidIndexId, TSTEMPLATEOID, @@ -642,7 +642,7 @@ static const ObjectPropertyType ObjectProperty[] = true, }, { - "type", + gettext_noop("type"), TypeRelationId, TypeOidIndexId, TYPEOID, @@ -656,7 +656,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "publication", + gettext_noop("publication"), PublicationRelationId, PublicationObjectIndexId, PUBLICATIONOID, @@ -670,7 +670,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "subscription", + gettext_noop("subscription"), SubscriptionRelationId, SubscriptionObjectIndexId, SUBSCRIPTIONOID, @@ -684,7 +684,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "extended statistics", + gettext_noop("extended statistics"), StatisticExtRelationId, StatisticExtOidIndexId, STATEXTOID, @@ -698,7 +698,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "user mapping", + gettext_noop("user mapping"), UserMappingRelationId, UserMappingOidIndexId, USERMAPPINGOID, diff --git a/src/backend/catalog/pg_depend.c b/src/backend/catalog/pg_depend.c index 9a7a401aced..0d28d34412d 100644 --- a/src/backend/catalog/pg_depend.c +++ b/src/backend/catalog/pg_depend.c @@ -810,7 +810,7 @@ dependencyLockAndCheckObject(Oid classId, Oid objectId) ereport(ERROR, (errcode(ERRCODE_UNDEFINED_OBJECT), errmsg("referenced %s was concurrently dropped", - get_object_class_descr(classId)))); + _(get_object_class_descr(classId))))); systable_endscan(scan); table_close(rel, AccessShareLock); -- 2.52.0 ----Next_Part(Fri_Jul__3_15_37_42_2026_665)---- ^ permalink raw reply [nested|flat] 34+ messages in thread
* [PATCH v1] Mark object class descriptions for translation @ 2026-07-03 06:06 Kyotaro Horiguchi <[email protected]> 0 siblings, 0 replies; 34+ messages in thread From: Kyotaro Horiguchi @ 2026-07-03 06:06 UTC (permalink / raw) ObjectPropertyType.class_descr was originally intended for internal error messages, but is now also used in a translated error message. Mark the object class descriptions for translation and translate the return value of get_object_class_descr(). --- src/backend/catalog/objectaddress.c | 88 ++++++++++++++--------------- src/backend/catalog/pg_depend.c | 2 +- 2 files changed, 45 insertions(+), 45 deletions(-) diff --git a/src/backend/catalog/objectaddress.c b/src/backend/catalog/objectaddress.c index af0e4703616..12dc76b712a 100644 --- a/src/backend/catalog/objectaddress.c +++ b/src/backend/catalog/objectaddress.c @@ -100,8 +100,8 @@ */ typedef struct { - const char *class_descr; /* string describing the catalog, for internal - * error messages */ + const char *class_descr; /* string describing the catalog, for error + * messages */ Oid class_oid; /* oid of catalog */ Oid oid_index_oid; /* oid of index on system oid column */ SysCacheIdentifier oid_catcache_id; /* id of catcache on system oid column */ @@ -124,7 +124,7 @@ typedef struct static const ObjectPropertyType ObjectProperty[] = { { - "access method", + gettext_noop("access method"), AccessMethodRelationId, AmOidIndexId, AMOID, @@ -138,7 +138,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "access method operator", + gettext_noop("access method operator"), AccessMethodOperatorRelationId, AccessMethodOperatorOidIndexId, SYSCACHEID_INVALID, @@ -152,7 +152,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "access method procedure", + gettext_noop("access method procedure"), AccessMethodProcedureRelationId, AccessMethodProcedureOidIndexId, SYSCACHEID_INVALID, @@ -166,7 +166,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "cast", + gettext_noop("cast"), CastRelationId, CastOidIndexId, SYSCACHEID_INVALID, @@ -180,7 +180,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "collation", + gettext_noop("collation"), CollationRelationId, CollationOidIndexId, COLLOID, @@ -194,7 +194,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "constraint", + gettext_noop("constraint"), ConstraintRelationId, ConstraintOidIndexId, CONSTROID, @@ -208,7 +208,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "conversion", + gettext_noop("conversion"), ConversionRelationId, ConversionOidIndexId, CONVOID, @@ -222,7 +222,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "database", + gettext_noop("database"), DatabaseRelationId, DatabaseOidIndexId, DATABASEOID, @@ -236,7 +236,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "default ACL", + gettext_noop("default ACL"), DefaultAclRelationId, DefaultAclOidIndexId, SYSCACHEID_INVALID, @@ -250,7 +250,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "extension", + gettext_noop("extension"), ExtensionRelationId, ExtensionOidIndexId, SYSCACHEID_INVALID, @@ -264,7 +264,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "foreign-data wrapper", + gettext_noop("foreign-data wrapper"), ForeignDataWrapperRelationId, ForeignDataWrapperOidIndexId, FOREIGNDATAWRAPPEROID, @@ -278,7 +278,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "foreign server", + gettext_noop("foreign server"), ForeignServerRelationId, ForeignServerOidIndexId, FOREIGNSERVEROID, @@ -292,7 +292,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "function", + gettext_noop("function"), ProcedureRelationId, ProcedureOidIndexId, PROCOID, @@ -306,7 +306,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "language", + gettext_noop("language"), LanguageRelationId, LanguageOidIndexId, LANGOID, @@ -320,7 +320,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "large object metadata", + gettext_noop("large object metadata"), LargeObjectMetadataRelationId, LargeObjectMetadataOidIndexId, SYSCACHEID_INVALID, @@ -334,7 +334,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "operator class", + gettext_noop("operator class"), OperatorClassRelationId, OpclassOidIndexId, CLAOID, @@ -348,7 +348,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "operator", + gettext_noop("operator"), OperatorRelationId, OperatorOidIndexId, OPEROID, @@ -362,7 +362,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "operator family", + gettext_noop("operator family"), OperatorFamilyRelationId, OpfamilyOidIndexId, OPFAMILYOID, @@ -376,7 +376,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "property graph element", + gettext_noop("property graph element"), PropgraphElementRelationId, PropgraphElementObjectIndexId, PROPGRAPHELOID, @@ -390,7 +390,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph element label", + gettext_noop("property graph element label"), PropgraphElementLabelRelationId, PropgraphElementLabelObjectIndexId, -1, @@ -404,7 +404,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph label", + gettext_noop("property graph label"), PropgraphLabelRelationId, PropgraphLabelObjectIndexId, PROPGRAPHLABELOID, @@ -418,7 +418,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph label property", + gettext_noop("property graph label property"), PropgraphLabelPropertyRelationId, PropgraphLabelPropertyObjectIndexId, -1, @@ -432,7 +432,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph property", + gettext_noop("property graph property"), PropgraphPropertyRelationId, PropgraphPropertyObjectIndexId, -1, @@ -446,7 +446,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "role", + gettext_noop("role"), AuthIdRelationId, AuthIdOidIndexId, AUTHOID, @@ -460,7 +460,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "role membership", + gettext_noop("role membership"), AuthMemRelationId, AuthMemOidIndexId, SYSCACHEID_INVALID, @@ -474,7 +474,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "rule", + gettext_noop("rule"), RewriteRelationId, RewriteOidIndexId, SYSCACHEID_INVALID, @@ -488,7 +488,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "schema", + gettext_noop("schema"), NamespaceRelationId, NamespaceOidIndexId, NAMESPACEOID, @@ -502,7 +502,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "relation", + gettext_noop("relation"), RelationRelationId, ClassOidIndexId, RELOID, @@ -516,7 +516,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "tablespace", + gettext_noop("tablespace"), TableSpaceRelationId, TablespaceOidIndexId, TABLESPACEOID, @@ -530,7 +530,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "transform", + gettext_noop("transform"), TransformRelationId, TransformOidIndexId, TRFOID, @@ -544,7 +544,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "trigger", + gettext_noop("trigger"), TriggerRelationId, TriggerOidIndexId, SYSCACHEID_INVALID, @@ -558,7 +558,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "policy", + gettext_noop("policy"), PolicyRelationId, PolicyOidIndexId, SYSCACHEID_INVALID, @@ -572,7 +572,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "event trigger", + gettext_noop("event trigger"), EventTriggerRelationId, EventTriggerOidIndexId, EVENTTRIGGEROID, @@ -586,7 +586,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search configuration", + gettext_noop("text search configuration"), TSConfigRelationId, TSConfigOidIndexId, TSCONFIGOID, @@ -600,7 +600,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search dictionary", + gettext_noop("text search dictionary"), TSDictionaryRelationId, TSDictionaryOidIndexId, TSDICTOID, @@ -614,7 +614,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search parser", + gettext_noop("text search parser"), TSParserRelationId, TSParserOidIndexId, TSPARSEROID, @@ -628,7 +628,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search template", + gettext_noop("text search template"), TSTemplateRelationId, TSTemplateOidIndexId, TSTEMPLATEOID, @@ -642,7 +642,7 @@ static const ObjectPropertyType ObjectProperty[] = true, }, { - "type", + gettext_noop("type"), TypeRelationId, TypeOidIndexId, TYPEOID, @@ -656,7 +656,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "publication", + gettext_noop("publication"), PublicationRelationId, PublicationObjectIndexId, PUBLICATIONOID, @@ -670,7 +670,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "subscription", + gettext_noop("subscription"), SubscriptionRelationId, SubscriptionObjectIndexId, SUBSCRIPTIONOID, @@ -684,7 +684,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "extended statistics", + gettext_noop("extended statistics"), StatisticExtRelationId, StatisticExtOidIndexId, STATEXTOID, @@ -698,7 +698,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "user mapping", + gettext_noop("user mapping"), UserMappingRelationId, UserMappingOidIndexId, USERMAPPINGOID, diff --git a/src/backend/catalog/pg_depend.c b/src/backend/catalog/pg_depend.c index 9a7a401aced..0d28d34412d 100644 --- a/src/backend/catalog/pg_depend.c +++ b/src/backend/catalog/pg_depend.c @@ -810,7 +810,7 @@ dependencyLockAndCheckObject(Oid classId, Oid objectId) ereport(ERROR, (errcode(ERRCODE_UNDEFINED_OBJECT), errmsg("referenced %s was concurrently dropped", - get_object_class_descr(classId)))); + _(get_object_class_descr(classId))))); systable_endscan(scan); table_close(rel, AccessShareLock); -- 2.52.0 ----Next_Part(Fri_Jul__3_15_37_42_2026_665)---- ^ permalink raw reply [nested|flat] 34+ messages in thread
* [PATCH v1] Mark object class descriptions for translation @ 2026-07-03 06:06 Kyotaro Horiguchi <[email protected]> 0 siblings, 0 replies; 34+ messages in thread From: Kyotaro Horiguchi @ 2026-07-03 06:06 UTC (permalink / raw) ObjectPropertyType.class_descr was originally intended for internal error messages, but is now also used in a translated error message. Mark the object class descriptions for translation and translate the return value of get_object_class_descr(). --- src/backend/catalog/objectaddress.c | 88 ++++++++++++++--------------- src/backend/catalog/pg_depend.c | 2 +- 2 files changed, 45 insertions(+), 45 deletions(-) diff --git a/src/backend/catalog/objectaddress.c b/src/backend/catalog/objectaddress.c index af0e4703616..12dc76b712a 100644 --- a/src/backend/catalog/objectaddress.c +++ b/src/backend/catalog/objectaddress.c @@ -100,8 +100,8 @@ */ typedef struct { - const char *class_descr; /* string describing the catalog, for internal - * error messages */ + const char *class_descr; /* string describing the catalog, for error + * messages */ Oid class_oid; /* oid of catalog */ Oid oid_index_oid; /* oid of index on system oid column */ SysCacheIdentifier oid_catcache_id; /* id of catcache on system oid column */ @@ -124,7 +124,7 @@ typedef struct static const ObjectPropertyType ObjectProperty[] = { { - "access method", + gettext_noop("access method"), AccessMethodRelationId, AmOidIndexId, AMOID, @@ -138,7 +138,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "access method operator", + gettext_noop("access method operator"), AccessMethodOperatorRelationId, AccessMethodOperatorOidIndexId, SYSCACHEID_INVALID, @@ -152,7 +152,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "access method procedure", + gettext_noop("access method procedure"), AccessMethodProcedureRelationId, AccessMethodProcedureOidIndexId, SYSCACHEID_INVALID, @@ -166,7 +166,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "cast", + gettext_noop("cast"), CastRelationId, CastOidIndexId, SYSCACHEID_INVALID, @@ -180,7 +180,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "collation", + gettext_noop("collation"), CollationRelationId, CollationOidIndexId, COLLOID, @@ -194,7 +194,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "constraint", + gettext_noop("constraint"), ConstraintRelationId, ConstraintOidIndexId, CONSTROID, @@ -208,7 +208,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "conversion", + gettext_noop("conversion"), ConversionRelationId, ConversionOidIndexId, CONVOID, @@ -222,7 +222,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "database", + gettext_noop("database"), DatabaseRelationId, DatabaseOidIndexId, DATABASEOID, @@ -236,7 +236,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "default ACL", + gettext_noop("default ACL"), DefaultAclRelationId, DefaultAclOidIndexId, SYSCACHEID_INVALID, @@ -250,7 +250,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "extension", + gettext_noop("extension"), ExtensionRelationId, ExtensionOidIndexId, SYSCACHEID_INVALID, @@ -264,7 +264,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "foreign-data wrapper", + gettext_noop("foreign-data wrapper"), ForeignDataWrapperRelationId, ForeignDataWrapperOidIndexId, FOREIGNDATAWRAPPEROID, @@ -278,7 +278,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "foreign server", + gettext_noop("foreign server"), ForeignServerRelationId, ForeignServerOidIndexId, FOREIGNSERVEROID, @@ -292,7 +292,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "function", + gettext_noop("function"), ProcedureRelationId, ProcedureOidIndexId, PROCOID, @@ -306,7 +306,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "language", + gettext_noop("language"), LanguageRelationId, LanguageOidIndexId, LANGOID, @@ -320,7 +320,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "large object metadata", + gettext_noop("large object metadata"), LargeObjectMetadataRelationId, LargeObjectMetadataOidIndexId, SYSCACHEID_INVALID, @@ -334,7 +334,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "operator class", + gettext_noop("operator class"), OperatorClassRelationId, OpclassOidIndexId, CLAOID, @@ -348,7 +348,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "operator", + gettext_noop("operator"), OperatorRelationId, OperatorOidIndexId, OPEROID, @@ -362,7 +362,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "operator family", + gettext_noop("operator family"), OperatorFamilyRelationId, OpfamilyOidIndexId, OPFAMILYOID, @@ -376,7 +376,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "property graph element", + gettext_noop("property graph element"), PropgraphElementRelationId, PropgraphElementObjectIndexId, PROPGRAPHELOID, @@ -390,7 +390,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph element label", + gettext_noop("property graph element label"), PropgraphElementLabelRelationId, PropgraphElementLabelObjectIndexId, -1, @@ -404,7 +404,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph label", + gettext_noop("property graph label"), PropgraphLabelRelationId, PropgraphLabelObjectIndexId, PROPGRAPHLABELOID, @@ -418,7 +418,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph label property", + gettext_noop("property graph label property"), PropgraphLabelPropertyRelationId, PropgraphLabelPropertyObjectIndexId, -1, @@ -432,7 +432,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph property", + gettext_noop("property graph property"), PropgraphPropertyRelationId, PropgraphPropertyObjectIndexId, -1, @@ -446,7 +446,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "role", + gettext_noop("role"), AuthIdRelationId, AuthIdOidIndexId, AUTHOID, @@ -460,7 +460,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "role membership", + gettext_noop("role membership"), AuthMemRelationId, AuthMemOidIndexId, SYSCACHEID_INVALID, @@ -474,7 +474,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "rule", + gettext_noop("rule"), RewriteRelationId, RewriteOidIndexId, SYSCACHEID_INVALID, @@ -488,7 +488,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "schema", + gettext_noop("schema"), NamespaceRelationId, NamespaceOidIndexId, NAMESPACEOID, @@ -502,7 +502,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "relation", + gettext_noop("relation"), RelationRelationId, ClassOidIndexId, RELOID, @@ -516,7 +516,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "tablespace", + gettext_noop("tablespace"), TableSpaceRelationId, TablespaceOidIndexId, TABLESPACEOID, @@ -530,7 +530,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "transform", + gettext_noop("transform"), TransformRelationId, TransformOidIndexId, TRFOID, @@ -544,7 +544,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "trigger", + gettext_noop("trigger"), TriggerRelationId, TriggerOidIndexId, SYSCACHEID_INVALID, @@ -558,7 +558,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "policy", + gettext_noop("policy"), PolicyRelationId, PolicyOidIndexId, SYSCACHEID_INVALID, @@ -572,7 +572,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "event trigger", + gettext_noop("event trigger"), EventTriggerRelationId, EventTriggerOidIndexId, EVENTTRIGGEROID, @@ -586,7 +586,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search configuration", + gettext_noop("text search configuration"), TSConfigRelationId, TSConfigOidIndexId, TSCONFIGOID, @@ -600,7 +600,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search dictionary", + gettext_noop("text search dictionary"), TSDictionaryRelationId, TSDictionaryOidIndexId, TSDICTOID, @@ -614,7 +614,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search parser", + gettext_noop("text search parser"), TSParserRelationId, TSParserOidIndexId, TSPARSEROID, @@ -628,7 +628,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search template", + gettext_noop("text search template"), TSTemplateRelationId, TSTemplateOidIndexId, TSTEMPLATEOID, @@ -642,7 +642,7 @@ static const ObjectPropertyType ObjectProperty[] = true, }, { - "type", + gettext_noop("type"), TypeRelationId, TypeOidIndexId, TYPEOID, @@ -656,7 +656,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "publication", + gettext_noop("publication"), PublicationRelationId, PublicationObjectIndexId, PUBLICATIONOID, @@ -670,7 +670,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "subscription", + gettext_noop("subscription"), SubscriptionRelationId, SubscriptionObjectIndexId, SUBSCRIPTIONOID, @@ -684,7 +684,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "extended statistics", + gettext_noop("extended statistics"), StatisticExtRelationId, StatisticExtOidIndexId, STATEXTOID, @@ -698,7 +698,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "user mapping", + gettext_noop("user mapping"), UserMappingRelationId, UserMappingOidIndexId, USERMAPPINGOID, diff --git a/src/backend/catalog/pg_depend.c b/src/backend/catalog/pg_depend.c index 9a7a401aced..0d28d34412d 100644 --- a/src/backend/catalog/pg_depend.c +++ b/src/backend/catalog/pg_depend.c @@ -810,7 +810,7 @@ dependencyLockAndCheckObject(Oid classId, Oid objectId) ereport(ERROR, (errcode(ERRCODE_UNDEFINED_OBJECT), errmsg("referenced %s was concurrently dropped", - get_object_class_descr(classId)))); + _(get_object_class_descr(classId))))); systable_endscan(scan); table_close(rel, AccessShareLock); -- 2.52.0 ----Next_Part(Fri_Jul__3_15_37_42_2026_665)---- ^ permalink raw reply [nested|flat] 34+ messages in thread
* [PATCH v1] Mark object class descriptions for translation @ 2026-07-03 06:06 Kyotaro Horiguchi <[email protected]> 0 siblings, 0 replies; 34+ messages in thread From: Kyotaro Horiguchi @ 2026-07-03 06:06 UTC (permalink / raw) ObjectPropertyType.class_descr was originally intended for internal error messages, but is now also used in a translated error message. Mark the object class descriptions for translation and translate the return value of get_object_class_descr(). --- src/backend/catalog/objectaddress.c | 88 ++++++++++++++--------------- src/backend/catalog/pg_depend.c | 2 +- 2 files changed, 45 insertions(+), 45 deletions(-) diff --git a/src/backend/catalog/objectaddress.c b/src/backend/catalog/objectaddress.c index af0e4703616..12dc76b712a 100644 --- a/src/backend/catalog/objectaddress.c +++ b/src/backend/catalog/objectaddress.c @@ -100,8 +100,8 @@ */ typedef struct { - const char *class_descr; /* string describing the catalog, for internal - * error messages */ + const char *class_descr; /* string describing the catalog, for error + * messages */ Oid class_oid; /* oid of catalog */ Oid oid_index_oid; /* oid of index on system oid column */ SysCacheIdentifier oid_catcache_id; /* id of catcache on system oid column */ @@ -124,7 +124,7 @@ typedef struct static const ObjectPropertyType ObjectProperty[] = { { - "access method", + gettext_noop("access method"), AccessMethodRelationId, AmOidIndexId, AMOID, @@ -138,7 +138,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "access method operator", + gettext_noop("access method operator"), AccessMethodOperatorRelationId, AccessMethodOperatorOidIndexId, SYSCACHEID_INVALID, @@ -152,7 +152,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "access method procedure", + gettext_noop("access method procedure"), AccessMethodProcedureRelationId, AccessMethodProcedureOidIndexId, SYSCACHEID_INVALID, @@ -166,7 +166,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "cast", + gettext_noop("cast"), CastRelationId, CastOidIndexId, SYSCACHEID_INVALID, @@ -180,7 +180,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "collation", + gettext_noop("collation"), CollationRelationId, CollationOidIndexId, COLLOID, @@ -194,7 +194,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "constraint", + gettext_noop("constraint"), ConstraintRelationId, ConstraintOidIndexId, CONSTROID, @@ -208,7 +208,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "conversion", + gettext_noop("conversion"), ConversionRelationId, ConversionOidIndexId, CONVOID, @@ -222,7 +222,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "database", + gettext_noop("database"), DatabaseRelationId, DatabaseOidIndexId, DATABASEOID, @@ -236,7 +236,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "default ACL", + gettext_noop("default ACL"), DefaultAclRelationId, DefaultAclOidIndexId, SYSCACHEID_INVALID, @@ -250,7 +250,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "extension", + gettext_noop("extension"), ExtensionRelationId, ExtensionOidIndexId, SYSCACHEID_INVALID, @@ -264,7 +264,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "foreign-data wrapper", + gettext_noop("foreign-data wrapper"), ForeignDataWrapperRelationId, ForeignDataWrapperOidIndexId, FOREIGNDATAWRAPPEROID, @@ -278,7 +278,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "foreign server", + gettext_noop("foreign server"), ForeignServerRelationId, ForeignServerOidIndexId, FOREIGNSERVEROID, @@ -292,7 +292,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "function", + gettext_noop("function"), ProcedureRelationId, ProcedureOidIndexId, PROCOID, @@ -306,7 +306,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "language", + gettext_noop("language"), LanguageRelationId, LanguageOidIndexId, LANGOID, @@ -320,7 +320,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "large object metadata", + gettext_noop("large object metadata"), LargeObjectMetadataRelationId, LargeObjectMetadataOidIndexId, SYSCACHEID_INVALID, @@ -334,7 +334,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "operator class", + gettext_noop("operator class"), OperatorClassRelationId, OpclassOidIndexId, CLAOID, @@ -348,7 +348,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "operator", + gettext_noop("operator"), OperatorRelationId, OperatorOidIndexId, OPEROID, @@ -362,7 +362,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "operator family", + gettext_noop("operator family"), OperatorFamilyRelationId, OpfamilyOidIndexId, OPFAMILYOID, @@ -376,7 +376,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "property graph element", + gettext_noop("property graph element"), PropgraphElementRelationId, PropgraphElementObjectIndexId, PROPGRAPHELOID, @@ -390,7 +390,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph element label", + gettext_noop("property graph element label"), PropgraphElementLabelRelationId, PropgraphElementLabelObjectIndexId, -1, @@ -404,7 +404,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph label", + gettext_noop("property graph label"), PropgraphLabelRelationId, PropgraphLabelObjectIndexId, PROPGRAPHLABELOID, @@ -418,7 +418,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph label property", + gettext_noop("property graph label property"), PropgraphLabelPropertyRelationId, PropgraphLabelPropertyObjectIndexId, -1, @@ -432,7 +432,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph property", + gettext_noop("property graph property"), PropgraphPropertyRelationId, PropgraphPropertyObjectIndexId, -1, @@ -446,7 +446,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "role", + gettext_noop("role"), AuthIdRelationId, AuthIdOidIndexId, AUTHOID, @@ -460,7 +460,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "role membership", + gettext_noop("role membership"), AuthMemRelationId, AuthMemOidIndexId, SYSCACHEID_INVALID, @@ -474,7 +474,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "rule", + gettext_noop("rule"), RewriteRelationId, RewriteOidIndexId, SYSCACHEID_INVALID, @@ -488,7 +488,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "schema", + gettext_noop("schema"), NamespaceRelationId, NamespaceOidIndexId, NAMESPACEOID, @@ -502,7 +502,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "relation", + gettext_noop("relation"), RelationRelationId, ClassOidIndexId, RELOID, @@ -516,7 +516,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "tablespace", + gettext_noop("tablespace"), TableSpaceRelationId, TablespaceOidIndexId, TABLESPACEOID, @@ -530,7 +530,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "transform", + gettext_noop("transform"), TransformRelationId, TransformOidIndexId, TRFOID, @@ -544,7 +544,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "trigger", + gettext_noop("trigger"), TriggerRelationId, TriggerOidIndexId, SYSCACHEID_INVALID, @@ -558,7 +558,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "policy", + gettext_noop("policy"), PolicyRelationId, PolicyOidIndexId, SYSCACHEID_INVALID, @@ -572,7 +572,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "event trigger", + gettext_noop("event trigger"), EventTriggerRelationId, EventTriggerOidIndexId, EVENTTRIGGEROID, @@ -586,7 +586,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search configuration", + gettext_noop("text search configuration"), TSConfigRelationId, TSConfigOidIndexId, TSCONFIGOID, @@ -600,7 +600,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search dictionary", + gettext_noop("text search dictionary"), TSDictionaryRelationId, TSDictionaryOidIndexId, TSDICTOID, @@ -614,7 +614,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search parser", + gettext_noop("text search parser"), TSParserRelationId, TSParserOidIndexId, TSPARSEROID, @@ -628,7 +628,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search template", + gettext_noop("text search template"), TSTemplateRelationId, TSTemplateOidIndexId, TSTEMPLATEOID, @@ -642,7 +642,7 @@ static const ObjectPropertyType ObjectProperty[] = true, }, { - "type", + gettext_noop("type"), TypeRelationId, TypeOidIndexId, TYPEOID, @@ -656,7 +656,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "publication", + gettext_noop("publication"), PublicationRelationId, PublicationObjectIndexId, PUBLICATIONOID, @@ -670,7 +670,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "subscription", + gettext_noop("subscription"), SubscriptionRelationId, SubscriptionObjectIndexId, SUBSCRIPTIONOID, @@ -684,7 +684,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "extended statistics", + gettext_noop("extended statistics"), StatisticExtRelationId, StatisticExtOidIndexId, STATEXTOID, @@ -698,7 +698,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "user mapping", + gettext_noop("user mapping"), UserMappingRelationId, UserMappingOidIndexId, USERMAPPINGOID, diff --git a/src/backend/catalog/pg_depend.c b/src/backend/catalog/pg_depend.c index 9a7a401aced..0d28d34412d 100644 --- a/src/backend/catalog/pg_depend.c +++ b/src/backend/catalog/pg_depend.c @@ -810,7 +810,7 @@ dependencyLockAndCheckObject(Oid classId, Oid objectId) ereport(ERROR, (errcode(ERRCODE_UNDEFINED_OBJECT), errmsg("referenced %s was concurrently dropped", - get_object_class_descr(classId)))); + _(get_object_class_descr(classId))))); systable_endscan(scan); table_close(rel, AccessShareLock); -- 2.52.0 ----Next_Part(Fri_Jul__3_15_37_42_2026_665)---- ^ permalink raw reply [nested|flat] 34+ messages in thread
* [PATCH v1] Mark object class descriptions for translation @ 2026-07-03 06:06 Kyotaro Horiguchi <[email protected]> 0 siblings, 0 replies; 34+ messages in thread From: Kyotaro Horiguchi @ 2026-07-03 06:06 UTC (permalink / raw) ObjectPropertyType.class_descr was originally intended for internal error messages, but is now also used in a translated error message. Mark the object class descriptions for translation and translate the return value of get_object_class_descr(). --- src/backend/catalog/objectaddress.c | 88 ++++++++++++++--------------- src/backend/catalog/pg_depend.c | 2 +- 2 files changed, 45 insertions(+), 45 deletions(-) diff --git a/src/backend/catalog/objectaddress.c b/src/backend/catalog/objectaddress.c index af0e4703616..12dc76b712a 100644 --- a/src/backend/catalog/objectaddress.c +++ b/src/backend/catalog/objectaddress.c @@ -100,8 +100,8 @@ */ typedef struct { - const char *class_descr; /* string describing the catalog, for internal - * error messages */ + const char *class_descr; /* string describing the catalog, for error + * messages */ Oid class_oid; /* oid of catalog */ Oid oid_index_oid; /* oid of index on system oid column */ SysCacheIdentifier oid_catcache_id; /* id of catcache on system oid column */ @@ -124,7 +124,7 @@ typedef struct static const ObjectPropertyType ObjectProperty[] = { { - "access method", + gettext_noop("access method"), AccessMethodRelationId, AmOidIndexId, AMOID, @@ -138,7 +138,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "access method operator", + gettext_noop("access method operator"), AccessMethodOperatorRelationId, AccessMethodOperatorOidIndexId, SYSCACHEID_INVALID, @@ -152,7 +152,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "access method procedure", + gettext_noop("access method procedure"), AccessMethodProcedureRelationId, AccessMethodProcedureOidIndexId, SYSCACHEID_INVALID, @@ -166,7 +166,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "cast", + gettext_noop("cast"), CastRelationId, CastOidIndexId, SYSCACHEID_INVALID, @@ -180,7 +180,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "collation", + gettext_noop("collation"), CollationRelationId, CollationOidIndexId, COLLOID, @@ -194,7 +194,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "constraint", + gettext_noop("constraint"), ConstraintRelationId, ConstraintOidIndexId, CONSTROID, @@ -208,7 +208,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "conversion", + gettext_noop("conversion"), ConversionRelationId, ConversionOidIndexId, CONVOID, @@ -222,7 +222,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "database", + gettext_noop("database"), DatabaseRelationId, DatabaseOidIndexId, DATABASEOID, @@ -236,7 +236,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "default ACL", + gettext_noop("default ACL"), DefaultAclRelationId, DefaultAclOidIndexId, SYSCACHEID_INVALID, @@ -250,7 +250,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "extension", + gettext_noop("extension"), ExtensionRelationId, ExtensionOidIndexId, SYSCACHEID_INVALID, @@ -264,7 +264,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "foreign-data wrapper", + gettext_noop("foreign-data wrapper"), ForeignDataWrapperRelationId, ForeignDataWrapperOidIndexId, FOREIGNDATAWRAPPEROID, @@ -278,7 +278,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "foreign server", + gettext_noop("foreign server"), ForeignServerRelationId, ForeignServerOidIndexId, FOREIGNSERVEROID, @@ -292,7 +292,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "function", + gettext_noop("function"), ProcedureRelationId, ProcedureOidIndexId, PROCOID, @@ -306,7 +306,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "language", + gettext_noop("language"), LanguageRelationId, LanguageOidIndexId, LANGOID, @@ -320,7 +320,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "large object metadata", + gettext_noop("large object metadata"), LargeObjectMetadataRelationId, LargeObjectMetadataOidIndexId, SYSCACHEID_INVALID, @@ -334,7 +334,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "operator class", + gettext_noop("operator class"), OperatorClassRelationId, OpclassOidIndexId, CLAOID, @@ -348,7 +348,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "operator", + gettext_noop("operator"), OperatorRelationId, OperatorOidIndexId, OPEROID, @@ -362,7 +362,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "operator family", + gettext_noop("operator family"), OperatorFamilyRelationId, OpfamilyOidIndexId, OPFAMILYOID, @@ -376,7 +376,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "property graph element", + gettext_noop("property graph element"), PropgraphElementRelationId, PropgraphElementObjectIndexId, PROPGRAPHELOID, @@ -390,7 +390,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph element label", + gettext_noop("property graph element label"), PropgraphElementLabelRelationId, PropgraphElementLabelObjectIndexId, -1, @@ -404,7 +404,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph label", + gettext_noop("property graph label"), PropgraphLabelRelationId, PropgraphLabelObjectIndexId, PROPGRAPHLABELOID, @@ -418,7 +418,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph label property", + gettext_noop("property graph label property"), PropgraphLabelPropertyRelationId, PropgraphLabelPropertyObjectIndexId, -1, @@ -432,7 +432,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph property", + gettext_noop("property graph property"), PropgraphPropertyRelationId, PropgraphPropertyObjectIndexId, -1, @@ -446,7 +446,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "role", + gettext_noop("role"), AuthIdRelationId, AuthIdOidIndexId, AUTHOID, @@ -460,7 +460,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "role membership", + gettext_noop("role membership"), AuthMemRelationId, AuthMemOidIndexId, SYSCACHEID_INVALID, @@ -474,7 +474,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "rule", + gettext_noop("rule"), RewriteRelationId, RewriteOidIndexId, SYSCACHEID_INVALID, @@ -488,7 +488,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "schema", + gettext_noop("schema"), NamespaceRelationId, NamespaceOidIndexId, NAMESPACEOID, @@ -502,7 +502,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "relation", + gettext_noop("relation"), RelationRelationId, ClassOidIndexId, RELOID, @@ -516,7 +516,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "tablespace", + gettext_noop("tablespace"), TableSpaceRelationId, TablespaceOidIndexId, TABLESPACEOID, @@ -530,7 +530,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "transform", + gettext_noop("transform"), TransformRelationId, TransformOidIndexId, TRFOID, @@ -544,7 +544,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "trigger", + gettext_noop("trigger"), TriggerRelationId, TriggerOidIndexId, SYSCACHEID_INVALID, @@ -558,7 +558,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "policy", + gettext_noop("policy"), PolicyRelationId, PolicyOidIndexId, SYSCACHEID_INVALID, @@ -572,7 +572,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "event trigger", + gettext_noop("event trigger"), EventTriggerRelationId, EventTriggerOidIndexId, EVENTTRIGGEROID, @@ -586,7 +586,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search configuration", + gettext_noop("text search configuration"), TSConfigRelationId, TSConfigOidIndexId, TSCONFIGOID, @@ -600,7 +600,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search dictionary", + gettext_noop("text search dictionary"), TSDictionaryRelationId, TSDictionaryOidIndexId, TSDICTOID, @@ -614,7 +614,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search parser", + gettext_noop("text search parser"), TSParserRelationId, TSParserOidIndexId, TSPARSEROID, @@ -628,7 +628,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search template", + gettext_noop("text search template"), TSTemplateRelationId, TSTemplateOidIndexId, TSTEMPLATEOID, @@ -642,7 +642,7 @@ static const ObjectPropertyType ObjectProperty[] = true, }, { - "type", + gettext_noop("type"), TypeRelationId, TypeOidIndexId, TYPEOID, @@ -656,7 +656,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "publication", + gettext_noop("publication"), PublicationRelationId, PublicationObjectIndexId, PUBLICATIONOID, @@ -670,7 +670,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "subscription", + gettext_noop("subscription"), SubscriptionRelationId, SubscriptionObjectIndexId, SUBSCRIPTIONOID, @@ -684,7 +684,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "extended statistics", + gettext_noop("extended statistics"), StatisticExtRelationId, StatisticExtOidIndexId, STATEXTOID, @@ -698,7 +698,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "user mapping", + gettext_noop("user mapping"), UserMappingRelationId, UserMappingOidIndexId, USERMAPPINGOID, diff --git a/src/backend/catalog/pg_depend.c b/src/backend/catalog/pg_depend.c index 9a7a401aced..0d28d34412d 100644 --- a/src/backend/catalog/pg_depend.c +++ b/src/backend/catalog/pg_depend.c @@ -810,7 +810,7 @@ dependencyLockAndCheckObject(Oid classId, Oid objectId) ereport(ERROR, (errcode(ERRCODE_UNDEFINED_OBJECT), errmsg("referenced %s was concurrently dropped", - get_object_class_descr(classId)))); + _(get_object_class_descr(classId))))); systable_endscan(scan); table_close(rel, AccessShareLock); -- 2.52.0 ----Next_Part(Fri_Jul__3_15_37_42_2026_665)---- ^ permalink raw reply [nested|flat] 34+ messages in thread
* [PATCH v1] Mark object class descriptions for translation @ 2026-07-03 06:06 Kyotaro Horiguchi <[email protected]> 0 siblings, 0 replies; 34+ messages in thread From: Kyotaro Horiguchi @ 2026-07-03 06:06 UTC (permalink / raw) ObjectPropertyType.class_descr was originally intended for internal error messages, but is now also used in a translated error message. Mark the object class descriptions for translation and translate the return value of get_object_class_descr(). --- src/backend/catalog/objectaddress.c | 88 ++++++++++++++--------------- src/backend/catalog/pg_depend.c | 2 +- 2 files changed, 45 insertions(+), 45 deletions(-) diff --git a/src/backend/catalog/objectaddress.c b/src/backend/catalog/objectaddress.c index af0e4703616..12dc76b712a 100644 --- a/src/backend/catalog/objectaddress.c +++ b/src/backend/catalog/objectaddress.c @@ -100,8 +100,8 @@ */ typedef struct { - const char *class_descr; /* string describing the catalog, for internal - * error messages */ + const char *class_descr; /* string describing the catalog, for error + * messages */ Oid class_oid; /* oid of catalog */ Oid oid_index_oid; /* oid of index on system oid column */ SysCacheIdentifier oid_catcache_id; /* id of catcache on system oid column */ @@ -124,7 +124,7 @@ typedef struct static const ObjectPropertyType ObjectProperty[] = { { - "access method", + gettext_noop("access method"), AccessMethodRelationId, AmOidIndexId, AMOID, @@ -138,7 +138,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "access method operator", + gettext_noop("access method operator"), AccessMethodOperatorRelationId, AccessMethodOperatorOidIndexId, SYSCACHEID_INVALID, @@ -152,7 +152,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "access method procedure", + gettext_noop("access method procedure"), AccessMethodProcedureRelationId, AccessMethodProcedureOidIndexId, SYSCACHEID_INVALID, @@ -166,7 +166,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "cast", + gettext_noop("cast"), CastRelationId, CastOidIndexId, SYSCACHEID_INVALID, @@ -180,7 +180,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "collation", + gettext_noop("collation"), CollationRelationId, CollationOidIndexId, COLLOID, @@ -194,7 +194,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "constraint", + gettext_noop("constraint"), ConstraintRelationId, ConstraintOidIndexId, CONSTROID, @@ -208,7 +208,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "conversion", + gettext_noop("conversion"), ConversionRelationId, ConversionOidIndexId, CONVOID, @@ -222,7 +222,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "database", + gettext_noop("database"), DatabaseRelationId, DatabaseOidIndexId, DATABASEOID, @@ -236,7 +236,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "default ACL", + gettext_noop("default ACL"), DefaultAclRelationId, DefaultAclOidIndexId, SYSCACHEID_INVALID, @@ -250,7 +250,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "extension", + gettext_noop("extension"), ExtensionRelationId, ExtensionOidIndexId, SYSCACHEID_INVALID, @@ -264,7 +264,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "foreign-data wrapper", + gettext_noop("foreign-data wrapper"), ForeignDataWrapperRelationId, ForeignDataWrapperOidIndexId, FOREIGNDATAWRAPPEROID, @@ -278,7 +278,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "foreign server", + gettext_noop("foreign server"), ForeignServerRelationId, ForeignServerOidIndexId, FOREIGNSERVEROID, @@ -292,7 +292,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "function", + gettext_noop("function"), ProcedureRelationId, ProcedureOidIndexId, PROCOID, @@ -306,7 +306,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "language", + gettext_noop("language"), LanguageRelationId, LanguageOidIndexId, LANGOID, @@ -320,7 +320,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "large object metadata", + gettext_noop("large object metadata"), LargeObjectMetadataRelationId, LargeObjectMetadataOidIndexId, SYSCACHEID_INVALID, @@ -334,7 +334,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "operator class", + gettext_noop("operator class"), OperatorClassRelationId, OpclassOidIndexId, CLAOID, @@ -348,7 +348,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "operator", + gettext_noop("operator"), OperatorRelationId, OperatorOidIndexId, OPEROID, @@ -362,7 +362,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "operator family", + gettext_noop("operator family"), OperatorFamilyRelationId, OpfamilyOidIndexId, OPFAMILYOID, @@ -376,7 +376,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "property graph element", + gettext_noop("property graph element"), PropgraphElementRelationId, PropgraphElementObjectIndexId, PROPGRAPHELOID, @@ -390,7 +390,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph element label", + gettext_noop("property graph element label"), PropgraphElementLabelRelationId, PropgraphElementLabelObjectIndexId, -1, @@ -404,7 +404,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph label", + gettext_noop("property graph label"), PropgraphLabelRelationId, PropgraphLabelObjectIndexId, PROPGRAPHLABELOID, @@ -418,7 +418,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph label property", + gettext_noop("property graph label property"), PropgraphLabelPropertyRelationId, PropgraphLabelPropertyObjectIndexId, -1, @@ -432,7 +432,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph property", + gettext_noop("property graph property"), PropgraphPropertyRelationId, PropgraphPropertyObjectIndexId, -1, @@ -446,7 +446,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "role", + gettext_noop("role"), AuthIdRelationId, AuthIdOidIndexId, AUTHOID, @@ -460,7 +460,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "role membership", + gettext_noop("role membership"), AuthMemRelationId, AuthMemOidIndexId, SYSCACHEID_INVALID, @@ -474,7 +474,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "rule", + gettext_noop("rule"), RewriteRelationId, RewriteOidIndexId, SYSCACHEID_INVALID, @@ -488,7 +488,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "schema", + gettext_noop("schema"), NamespaceRelationId, NamespaceOidIndexId, NAMESPACEOID, @@ -502,7 +502,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "relation", + gettext_noop("relation"), RelationRelationId, ClassOidIndexId, RELOID, @@ -516,7 +516,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "tablespace", + gettext_noop("tablespace"), TableSpaceRelationId, TablespaceOidIndexId, TABLESPACEOID, @@ -530,7 +530,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "transform", + gettext_noop("transform"), TransformRelationId, TransformOidIndexId, TRFOID, @@ -544,7 +544,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "trigger", + gettext_noop("trigger"), TriggerRelationId, TriggerOidIndexId, SYSCACHEID_INVALID, @@ -558,7 +558,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "policy", + gettext_noop("policy"), PolicyRelationId, PolicyOidIndexId, SYSCACHEID_INVALID, @@ -572,7 +572,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "event trigger", + gettext_noop("event trigger"), EventTriggerRelationId, EventTriggerOidIndexId, EVENTTRIGGEROID, @@ -586,7 +586,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search configuration", + gettext_noop("text search configuration"), TSConfigRelationId, TSConfigOidIndexId, TSCONFIGOID, @@ -600,7 +600,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search dictionary", + gettext_noop("text search dictionary"), TSDictionaryRelationId, TSDictionaryOidIndexId, TSDICTOID, @@ -614,7 +614,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search parser", + gettext_noop("text search parser"), TSParserRelationId, TSParserOidIndexId, TSPARSEROID, @@ -628,7 +628,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search template", + gettext_noop("text search template"), TSTemplateRelationId, TSTemplateOidIndexId, TSTEMPLATEOID, @@ -642,7 +642,7 @@ static const ObjectPropertyType ObjectProperty[] = true, }, { - "type", + gettext_noop("type"), TypeRelationId, TypeOidIndexId, TYPEOID, @@ -656,7 +656,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "publication", + gettext_noop("publication"), PublicationRelationId, PublicationObjectIndexId, PUBLICATIONOID, @@ -670,7 +670,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "subscription", + gettext_noop("subscription"), SubscriptionRelationId, SubscriptionObjectIndexId, SUBSCRIPTIONOID, @@ -684,7 +684,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "extended statistics", + gettext_noop("extended statistics"), StatisticExtRelationId, StatisticExtOidIndexId, STATEXTOID, @@ -698,7 +698,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "user mapping", + gettext_noop("user mapping"), UserMappingRelationId, UserMappingOidIndexId, USERMAPPINGOID, diff --git a/src/backend/catalog/pg_depend.c b/src/backend/catalog/pg_depend.c index 9a7a401aced..0d28d34412d 100644 --- a/src/backend/catalog/pg_depend.c +++ b/src/backend/catalog/pg_depend.c @@ -810,7 +810,7 @@ dependencyLockAndCheckObject(Oid classId, Oid objectId) ereport(ERROR, (errcode(ERRCODE_UNDEFINED_OBJECT), errmsg("referenced %s was concurrently dropped", - get_object_class_descr(classId)))); + _(get_object_class_descr(classId))))); systable_endscan(scan); table_close(rel, AccessShareLock); -- 2.52.0 ----Next_Part(Fri_Jul__3_15_37_42_2026_665)---- ^ permalink raw reply [nested|flat] 34+ messages in thread
* [PATCH v1] Mark object class descriptions for translation @ 2026-07-03 06:06 Kyotaro Horiguchi <[email protected]> 0 siblings, 0 replies; 34+ messages in thread From: Kyotaro Horiguchi @ 2026-07-03 06:06 UTC (permalink / raw) ObjectPropertyType.class_descr was originally intended for internal error messages, but is now also used in a translated error message. Mark the object class descriptions for translation and translate the return value of get_object_class_descr(). --- src/backend/catalog/objectaddress.c | 88 ++++++++++++++--------------- src/backend/catalog/pg_depend.c | 2 +- 2 files changed, 45 insertions(+), 45 deletions(-) diff --git a/src/backend/catalog/objectaddress.c b/src/backend/catalog/objectaddress.c index af0e4703616..12dc76b712a 100644 --- a/src/backend/catalog/objectaddress.c +++ b/src/backend/catalog/objectaddress.c @@ -100,8 +100,8 @@ */ typedef struct { - const char *class_descr; /* string describing the catalog, for internal - * error messages */ + const char *class_descr; /* string describing the catalog, for error + * messages */ Oid class_oid; /* oid of catalog */ Oid oid_index_oid; /* oid of index on system oid column */ SysCacheIdentifier oid_catcache_id; /* id of catcache on system oid column */ @@ -124,7 +124,7 @@ typedef struct static const ObjectPropertyType ObjectProperty[] = { { - "access method", + gettext_noop("access method"), AccessMethodRelationId, AmOidIndexId, AMOID, @@ -138,7 +138,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "access method operator", + gettext_noop("access method operator"), AccessMethodOperatorRelationId, AccessMethodOperatorOidIndexId, SYSCACHEID_INVALID, @@ -152,7 +152,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "access method procedure", + gettext_noop("access method procedure"), AccessMethodProcedureRelationId, AccessMethodProcedureOidIndexId, SYSCACHEID_INVALID, @@ -166,7 +166,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "cast", + gettext_noop("cast"), CastRelationId, CastOidIndexId, SYSCACHEID_INVALID, @@ -180,7 +180,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "collation", + gettext_noop("collation"), CollationRelationId, CollationOidIndexId, COLLOID, @@ -194,7 +194,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "constraint", + gettext_noop("constraint"), ConstraintRelationId, ConstraintOidIndexId, CONSTROID, @@ -208,7 +208,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "conversion", + gettext_noop("conversion"), ConversionRelationId, ConversionOidIndexId, CONVOID, @@ -222,7 +222,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "database", + gettext_noop("database"), DatabaseRelationId, DatabaseOidIndexId, DATABASEOID, @@ -236,7 +236,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "default ACL", + gettext_noop("default ACL"), DefaultAclRelationId, DefaultAclOidIndexId, SYSCACHEID_INVALID, @@ -250,7 +250,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "extension", + gettext_noop("extension"), ExtensionRelationId, ExtensionOidIndexId, SYSCACHEID_INVALID, @@ -264,7 +264,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "foreign-data wrapper", + gettext_noop("foreign-data wrapper"), ForeignDataWrapperRelationId, ForeignDataWrapperOidIndexId, FOREIGNDATAWRAPPEROID, @@ -278,7 +278,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "foreign server", + gettext_noop("foreign server"), ForeignServerRelationId, ForeignServerOidIndexId, FOREIGNSERVEROID, @@ -292,7 +292,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "function", + gettext_noop("function"), ProcedureRelationId, ProcedureOidIndexId, PROCOID, @@ -306,7 +306,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "language", + gettext_noop("language"), LanguageRelationId, LanguageOidIndexId, LANGOID, @@ -320,7 +320,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "large object metadata", + gettext_noop("large object metadata"), LargeObjectMetadataRelationId, LargeObjectMetadataOidIndexId, SYSCACHEID_INVALID, @@ -334,7 +334,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "operator class", + gettext_noop("operator class"), OperatorClassRelationId, OpclassOidIndexId, CLAOID, @@ -348,7 +348,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "operator", + gettext_noop("operator"), OperatorRelationId, OperatorOidIndexId, OPEROID, @@ -362,7 +362,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "operator family", + gettext_noop("operator family"), OperatorFamilyRelationId, OpfamilyOidIndexId, OPFAMILYOID, @@ -376,7 +376,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "property graph element", + gettext_noop("property graph element"), PropgraphElementRelationId, PropgraphElementObjectIndexId, PROPGRAPHELOID, @@ -390,7 +390,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph element label", + gettext_noop("property graph element label"), PropgraphElementLabelRelationId, PropgraphElementLabelObjectIndexId, -1, @@ -404,7 +404,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph label", + gettext_noop("property graph label"), PropgraphLabelRelationId, PropgraphLabelObjectIndexId, PROPGRAPHLABELOID, @@ -418,7 +418,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph label property", + gettext_noop("property graph label property"), PropgraphLabelPropertyRelationId, PropgraphLabelPropertyObjectIndexId, -1, @@ -432,7 +432,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph property", + gettext_noop("property graph property"), PropgraphPropertyRelationId, PropgraphPropertyObjectIndexId, -1, @@ -446,7 +446,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "role", + gettext_noop("role"), AuthIdRelationId, AuthIdOidIndexId, AUTHOID, @@ -460,7 +460,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "role membership", + gettext_noop("role membership"), AuthMemRelationId, AuthMemOidIndexId, SYSCACHEID_INVALID, @@ -474,7 +474,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "rule", + gettext_noop("rule"), RewriteRelationId, RewriteOidIndexId, SYSCACHEID_INVALID, @@ -488,7 +488,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "schema", + gettext_noop("schema"), NamespaceRelationId, NamespaceOidIndexId, NAMESPACEOID, @@ -502,7 +502,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "relation", + gettext_noop("relation"), RelationRelationId, ClassOidIndexId, RELOID, @@ -516,7 +516,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "tablespace", + gettext_noop("tablespace"), TableSpaceRelationId, TablespaceOidIndexId, TABLESPACEOID, @@ -530,7 +530,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "transform", + gettext_noop("transform"), TransformRelationId, TransformOidIndexId, TRFOID, @@ -544,7 +544,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "trigger", + gettext_noop("trigger"), TriggerRelationId, TriggerOidIndexId, SYSCACHEID_INVALID, @@ -558,7 +558,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "policy", + gettext_noop("policy"), PolicyRelationId, PolicyOidIndexId, SYSCACHEID_INVALID, @@ -572,7 +572,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "event trigger", + gettext_noop("event trigger"), EventTriggerRelationId, EventTriggerOidIndexId, EVENTTRIGGEROID, @@ -586,7 +586,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search configuration", + gettext_noop("text search configuration"), TSConfigRelationId, TSConfigOidIndexId, TSCONFIGOID, @@ -600,7 +600,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search dictionary", + gettext_noop("text search dictionary"), TSDictionaryRelationId, TSDictionaryOidIndexId, TSDICTOID, @@ -614,7 +614,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search parser", + gettext_noop("text search parser"), TSParserRelationId, TSParserOidIndexId, TSPARSEROID, @@ -628,7 +628,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search template", + gettext_noop("text search template"), TSTemplateRelationId, TSTemplateOidIndexId, TSTEMPLATEOID, @@ -642,7 +642,7 @@ static const ObjectPropertyType ObjectProperty[] = true, }, { - "type", + gettext_noop("type"), TypeRelationId, TypeOidIndexId, TYPEOID, @@ -656,7 +656,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "publication", + gettext_noop("publication"), PublicationRelationId, PublicationObjectIndexId, PUBLICATIONOID, @@ -670,7 +670,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "subscription", + gettext_noop("subscription"), SubscriptionRelationId, SubscriptionObjectIndexId, SUBSCRIPTIONOID, @@ -684,7 +684,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "extended statistics", + gettext_noop("extended statistics"), StatisticExtRelationId, StatisticExtOidIndexId, STATEXTOID, @@ -698,7 +698,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "user mapping", + gettext_noop("user mapping"), UserMappingRelationId, UserMappingOidIndexId, USERMAPPINGOID, diff --git a/src/backend/catalog/pg_depend.c b/src/backend/catalog/pg_depend.c index 9a7a401aced..0d28d34412d 100644 --- a/src/backend/catalog/pg_depend.c +++ b/src/backend/catalog/pg_depend.c @@ -810,7 +810,7 @@ dependencyLockAndCheckObject(Oid classId, Oid objectId) ereport(ERROR, (errcode(ERRCODE_UNDEFINED_OBJECT), errmsg("referenced %s was concurrently dropped", - get_object_class_descr(classId)))); + _(get_object_class_descr(classId))))); systable_endscan(scan); table_close(rel, AccessShareLock); -- 2.52.0 ----Next_Part(Fri_Jul__3_15_37_42_2026_665)---- ^ permalink raw reply [nested|flat] 34+ messages in thread
* [PATCH v1] Mark object class descriptions for translation @ 2026-07-03 06:06 Kyotaro Horiguchi <[email protected]> 0 siblings, 0 replies; 34+ messages in thread From: Kyotaro Horiguchi @ 2026-07-03 06:06 UTC (permalink / raw) ObjectPropertyType.class_descr was originally intended for internal error messages, but is now also used in a translated error message. Mark the object class descriptions for translation and translate the return value of get_object_class_descr(). --- src/backend/catalog/objectaddress.c | 88 ++++++++++++++--------------- src/backend/catalog/pg_depend.c | 2 +- 2 files changed, 45 insertions(+), 45 deletions(-) diff --git a/src/backend/catalog/objectaddress.c b/src/backend/catalog/objectaddress.c index af0e4703616..12dc76b712a 100644 --- a/src/backend/catalog/objectaddress.c +++ b/src/backend/catalog/objectaddress.c @@ -100,8 +100,8 @@ */ typedef struct { - const char *class_descr; /* string describing the catalog, for internal - * error messages */ + const char *class_descr; /* string describing the catalog, for error + * messages */ Oid class_oid; /* oid of catalog */ Oid oid_index_oid; /* oid of index on system oid column */ SysCacheIdentifier oid_catcache_id; /* id of catcache on system oid column */ @@ -124,7 +124,7 @@ typedef struct static const ObjectPropertyType ObjectProperty[] = { { - "access method", + gettext_noop("access method"), AccessMethodRelationId, AmOidIndexId, AMOID, @@ -138,7 +138,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "access method operator", + gettext_noop("access method operator"), AccessMethodOperatorRelationId, AccessMethodOperatorOidIndexId, SYSCACHEID_INVALID, @@ -152,7 +152,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "access method procedure", + gettext_noop("access method procedure"), AccessMethodProcedureRelationId, AccessMethodProcedureOidIndexId, SYSCACHEID_INVALID, @@ -166,7 +166,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "cast", + gettext_noop("cast"), CastRelationId, CastOidIndexId, SYSCACHEID_INVALID, @@ -180,7 +180,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "collation", + gettext_noop("collation"), CollationRelationId, CollationOidIndexId, COLLOID, @@ -194,7 +194,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "constraint", + gettext_noop("constraint"), ConstraintRelationId, ConstraintOidIndexId, CONSTROID, @@ -208,7 +208,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "conversion", + gettext_noop("conversion"), ConversionRelationId, ConversionOidIndexId, CONVOID, @@ -222,7 +222,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "database", + gettext_noop("database"), DatabaseRelationId, DatabaseOidIndexId, DATABASEOID, @@ -236,7 +236,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "default ACL", + gettext_noop("default ACL"), DefaultAclRelationId, DefaultAclOidIndexId, SYSCACHEID_INVALID, @@ -250,7 +250,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "extension", + gettext_noop("extension"), ExtensionRelationId, ExtensionOidIndexId, SYSCACHEID_INVALID, @@ -264,7 +264,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "foreign-data wrapper", + gettext_noop("foreign-data wrapper"), ForeignDataWrapperRelationId, ForeignDataWrapperOidIndexId, FOREIGNDATAWRAPPEROID, @@ -278,7 +278,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "foreign server", + gettext_noop("foreign server"), ForeignServerRelationId, ForeignServerOidIndexId, FOREIGNSERVEROID, @@ -292,7 +292,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "function", + gettext_noop("function"), ProcedureRelationId, ProcedureOidIndexId, PROCOID, @@ -306,7 +306,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "language", + gettext_noop("language"), LanguageRelationId, LanguageOidIndexId, LANGOID, @@ -320,7 +320,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "large object metadata", + gettext_noop("large object metadata"), LargeObjectMetadataRelationId, LargeObjectMetadataOidIndexId, SYSCACHEID_INVALID, @@ -334,7 +334,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "operator class", + gettext_noop("operator class"), OperatorClassRelationId, OpclassOidIndexId, CLAOID, @@ -348,7 +348,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "operator", + gettext_noop("operator"), OperatorRelationId, OperatorOidIndexId, OPEROID, @@ -362,7 +362,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "operator family", + gettext_noop("operator family"), OperatorFamilyRelationId, OpfamilyOidIndexId, OPFAMILYOID, @@ -376,7 +376,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "property graph element", + gettext_noop("property graph element"), PropgraphElementRelationId, PropgraphElementObjectIndexId, PROPGRAPHELOID, @@ -390,7 +390,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph element label", + gettext_noop("property graph element label"), PropgraphElementLabelRelationId, PropgraphElementLabelObjectIndexId, -1, @@ -404,7 +404,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph label", + gettext_noop("property graph label"), PropgraphLabelRelationId, PropgraphLabelObjectIndexId, PROPGRAPHLABELOID, @@ -418,7 +418,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph label property", + gettext_noop("property graph label property"), PropgraphLabelPropertyRelationId, PropgraphLabelPropertyObjectIndexId, -1, @@ -432,7 +432,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "property graph property", + gettext_noop("property graph property"), PropgraphPropertyRelationId, PropgraphPropertyObjectIndexId, -1, @@ -446,7 +446,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "role", + gettext_noop("role"), AuthIdRelationId, AuthIdOidIndexId, AUTHOID, @@ -460,7 +460,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "role membership", + gettext_noop("role membership"), AuthMemRelationId, AuthMemOidIndexId, SYSCACHEID_INVALID, @@ -474,7 +474,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "rule", + gettext_noop("rule"), RewriteRelationId, RewriteOidIndexId, SYSCACHEID_INVALID, @@ -488,7 +488,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "schema", + gettext_noop("schema"), NamespaceRelationId, NamespaceOidIndexId, NAMESPACEOID, @@ -502,7 +502,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "relation", + gettext_noop("relation"), RelationRelationId, ClassOidIndexId, RELOID, @@ -516,7 +516,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "tablespace", + gettext_noop("tablespace"), TableSpaceRelationId, TablespaceOidIndexId, TABLESPACEOID, @@ -530,7 +530,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "transform", + gettext_noop("transform"), TransformRelationId, TransformOidIndexId, TRFOID, @@ -544,7 +544,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "trigger", + gettext_noop("trigger"), TriggerRelationId, TriggerOidIndexId, SYSCACHEID_INVALID, @@ -558,7 +558,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "policy", + gettext_noop("policy"), PolicyRelationId, PolicyOidIndexId, SYSCACHEID_INVALID, @@ -572,7 +572,7 @@ static const ObjectPropertyType ObjectProperty[] = false }, { - "event trigger", + gettext_noop("event trigger"), EventTriggerRelationId, EventTriggerOidIndexId, EVENTTRIGGEROID, @@ -586,7 +586,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search configuration", + gettext_noop("text search configuration"), TSConfigRelationId, TSConfigOidIndexId, TSCONFIGOID, @@ -600,7 +600,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search dictionary", + gettext_noop("text search dictionary"), TSDictionaryRelationId, TSDictionaryOidIndexId, TSDICTOID, @@ -614,7 +614,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search parser", + gettext_noop("text search parser"), TSParserRelationId, TSParserOidIndexId, TSPARSEROID, @@ -628,7 +628,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "text search template", + gettext_noop("text search template"), TSTemplateRelationId, TSTemplateOidIndexId, TSTEMPLATEOID, @@ -642,7 +642,7 @@ static const ObjectPropertyType ObjectProperty[] = true, }, { - "type", + gettext_noop("type"), TypeRelationId, TypeOidIndexId, TYPEOID, @@ -656,7 +656,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "publication", + gettext_noop("publication"), PublicationRelationId, PublicationObjectIndexId, PUBLICATIONOID, @@ -670,7 +670,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "subscription", + gettext_noop("subscription"), SubscriptionRelationId, SubscriptionObjectIndexId, SUBSCRIPTIONOID, @@ -684,7 +684,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "extended statistics", + gettext_noop("extended statistics"), StatisticExtRelationId, StatisticExtOidIndexId, STATEXTOID, @@ -698,7 +698,7 @@ static const ObjectPropertyType ObjectProperty[] = true }, { - "user mapping", + gettext_noop("user mapping"), UserMappingRelationId, UserMappingOidIndexId, USERMAPPINGOID, diff --git a/src/backend/catalog/pg_depend.c b/src/backend/catalog/pg_depend.c index 9a7a401aced..0d28d34412d 100644 --- a/src/backend/catalog/pg_depend.c +++ b/src/backend/catalog/pg_depend.c @@ -810,7 +810,7 @@ dependencyLockAndCheckObject(Oid classId, Oid objectId) ereport(ERROR, (errcode(ERRCODE_UNDEFINED_OBJECT), errmsg("referenced %s was concurrently dropped", - get_object_class_descr(classId)))); + _(get_object_class_descr(classId))))); systable_endscan(scan); table_close(rel, AccessShareLock); -- 2.52.0 ----Next_Part(Fri_Jul__3_15_37_42_2026_665)---- ^ permalink raw reply [nested|flat] 34+ messages in thread
end of thread, other threads:[~2026-07-03 06:06 UTC | newest] Thread overview: 34+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2023-08-09 07:56 [PATCH v4 4/7] Row pattern recognition patch (executor). Tatsuo Ishii <[email protected]> 2026-07-03 06:06 [PATCH v1] Mark object class descriptions for translation Kyotaro Horiguchi <[email protected]> 2026-07-03 06:06 [PATCH v1] Mark object class descriptions for translation Kyotaro Horiguchi <[email protected]> 2026-07-03 06:06 [PATCH v1] Mark object class descriptions for translation Kyotaro Horiguchi <[email protected]> 2026-07-03 06:06 [PATCH v1] Mark object class descriptions for translation Kyotaro Horiguchi <[email protected]> 2026-07-03 06:06 [PATCH v1] Mark object class descriptions for translation Kyotaro Horiguchi <[email protected]> 2026-07-03 06:06 [PATCH v1] Mark object class descriptions for translation Kyotaro Horiguchi <[email protected]> 2026-07-03 06:06 [PATCH v1] Mark object class descriptions for translation Kyotaro Horiguchi <[email protected]> 2026-07-03 06:06 [PATCH v1] Mark object class descriptions for translation Kyotaro Horiguchi <[email protected]> 2026-07-03 06:06 [PATCH v1] Mark object class descriptions for translation Kyotaro Horiguchi <[email protected]> 2026-07-03 06:06 [PATCH v1] Mark object class descriptions for translation Kyotaro Horiguchi <[email protected]> 2026-07-03 06:06 [PATCH v1] Mark object class descriptions for translation Kyotaro Horiguchi <[email protected]> 2026-07-03 06:06 [PATCH v1] Mark object class descriptions for translation Kyotaro Horiguchi <[email protected]> 2026-07-03 06:06 [PATCH v1] Mark object class descriptions for translation Kyotaro Horiguchi <[email protected]> 2026-07-03 06:06 [PATCH v1] Mark object class descriptions for translation Kyotaro Horiguchi <[email protected]> 2026-07-03 06:06 [PATCH v1] Mark object class descriptions for translation Kyotaro Horiguchi <[email protected]> 2026-07-03 06:06 [PATCH v1] Mark object class descriptions for translation Kyotaro Horiguchi <[email protected]> 2026-07-03 06:06 [PATCH v1] Mark object class descriptions for translation Kyotaro Horiguchi <[email protected]> 2026-07-03 06:06 [PATCH v1] Mark object class descriptions for translation Kyotaro Horiguchi <[email protected]> 2026-07-03 06:06 [PATCH v1] Mark object class descriptions for translation Kyotaro Horiguchi <[email protected]> 2026-07-03 06:06 [PATCH v1] Mark object class descriptions for translation Kyotaro Horiguchi <[email protected]> 2026-07-03 06:06 [PATCH v1] Mark object class descriptions for translation Kyotaro Horiguchi <[email protected]> 2026-07-03 06:06 [PATCH v1] Mark object class descriptions for translation Kyotaro Horiguchi <[email protected]> 2026-07-03 06:06 [PATCH v1] Mark object class descriptions for translation Kyotaro Horiguchi <[email protected]> 2026-07-03 06:06 [PATCH v1] Mark object class descriptions for translation Kyotaro Horiguchi <[email protected]> 2026-07-03 06:06 [PATCH v1] Mark object class descriptions for translation Kyotaro Horiguchi <[email protected]> 2026-07-03 06:06 [PATCH v1] Mark object class descriptions for translation Kyotaro Horiguchi <[email protected]> 2026-07-03 06:06 [PATCH v1] Mark object class descriptions for translation Kyotaro Horiguchi <[email protected]> 2026-07-03 06:06 [PATCH v1] Mark object class descriptions for translation Kyotaro Horiguchi <[email protected]> 2026-07-03 06:06 [PATCH v1] Mark object class descriptions for translation Kyotaro Horiguchi <[email protected]> 2026-07-03 06:06 [PATCH v1] Mark object class descriptions for translation Kyotaro Horiguchi <[email protected]> 2026-07-03 06:06 [PATCH v1] Mark object class descriptions for translation Kyotaro Horiguchi <[email protected]> 2026-07-03 06:06 [PATCH v1] Mark object class descriptions for translation Kyotaro Horiguchi <[email protected]> 2026-07-03 06:06 [PATCH v1] Mark object class descriptions for translation Kyotaro Horiguchi <[email protected]>
This inbox is served by agora; see mirroring instructions for how to clone and mirror all data and code used for this inbox