Re: Refactor construct_array() and deconstruct_array() for built-in types

Поиск
Список
Период
Сортировка
От Dagfinn Ilmari Mannsåker
Тема Re: Refactor construct_array() and deconstruct_array() for built-in types
Дата
Msg-id 87y1xdjei1.fsf@wibble.ilmari.org
обсуждение исходный текст
Ответ на Re: Refactor construct_array() and deconstruct_array() for built-in types  (Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>)
Ответы Re: Refactor construct_array() and deconstruct_array() for built-in types  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Dagfinn Ilmari Mannsåker <ilmari@ilmari.org> writes:

> I dind't pay much attention to this thread earlier, but I was struck by
> the duplication of the switch statement determining the elemlen,
> elembyval, and elemalign values between the construct and deconstruct
> functions.  How about a common function they can both call?  Something
> like:
>
> static void builtin_type_details(Oid elemtype,
>                                  int *elemlen,
>                                  bool *elembyval,
>                                  char *elemalign);

I just realised that this would require the error message to not include
the function name (which isn't really that critical, since it's a
developer-facing message), but an option would to make it return false
for unknown types, so each of the calling functions can emit their own
error message.

> - ilmari



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Dagfinn Ilmari Mannsåker
Дата:
Сообщение: Re: Refactor construct_array() and deconstruct_array() for built-in types
Следующее
От: Ranier Vilela
Дата:
Сообщение: Re: Avoid unecessary MemSet call (src/backend/utils/cache/relcache.c)