Re: not null constraints, again

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: not null constraints, again
Дата
Msg-id 202411121043.kselx23nuhri@alvherre.pgsql
обсуждение исходный текст
Ответ на Re: not null constraints, again  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
Ответы Re: not null constraints, again
Список pgsql-hackers
On 2024-Nov-09, Alvaro Herrera wrote:

> I notice I cargo-culted a "free de-toasted copy", but I think it's
> impossible to end up with a toasted datum here, because the column is
> guaranteed to have only one element, so not a candidate for toasting.
> But also, if we don't free it (in case somebody does an UPDATE to the
> catalog with a large array), nothing happens, because memory is going to
> be released soon anyway, by the error that results by conkey not being
> one element long.

I found out that my claim that it's impossible to have a detoasted datum
was false: because the value is so small, we end up with a short
varlena, which does use a separate palloc().  I decided to remove the
pfree() anyway, because that makes it easier to return the value we want
without having to first assign it away from the chunk we'd pfree.
The DDL code mostly doesn't worry too much about memory leaks anyway,
and this one is very small.

-- 
Álvaro Herrera         PostgreSQL Developer  —  https://www.EnterpriseDB.com/
“Cuando no hay humildad las personas se degradan” (A. Christie)



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