Re: [PATCH 2/5] Make relpathbackend return a statically result instead of palloc()'ing it

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [PATCH 2/5] Make relpathbackend return a statically result instead of palloc()'ing it
Дата
Msg-id 21944.1357673294@sss.pgh.pa.us
обсуждение исходный текст
Ответ на [PATCH 2/5] Make relpathbackend return a statically result instead of palloc()'ing it  (Andres Freund <andres@2ndquadrant.com>)
Ответы Re: [PATCH 2/5] Make relpathbackend return a statically result instead of palloc()'ing it  (Andres Freund <andres@2ndquadrant.com>)
Список pgsql-hackers
Andres Freund <andres@2ndquadrant.com> writes:
maxpg> From: Andres Freund <andres@anarazel.de>
> relpathbackend() (via some of its wrappers) is used in *_desc routines which we
> want to be useable without a backend environment arround.

I'm 100% unimpressed with making relpathbackend return a pointer to a
static buffer.  Who's to say whether that won't create bugs due to
overlapping usages?

> Change signature to return a 'const char *' to make misuse easier to
> detect.

That seems to create way more churn than is necessary, and it's wrong
anyway if the result is palloc'd.
        regards, tom lane



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

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: [PATCH] xlogreader-v4
Следующее
От: Andres Freund
Дата:
Сообщение: Re: [PATCH 1/5] Centralize Assert* macros into c.h so its common between backend/frontend