Re: pgsql: Exclude unlogged tables from base backups

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: pgsql: Exclude unlogged tables from base backups
Дата
Msg-id 5114.1522007696@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: pgsql: Exclude unlogged tables from base backups  (David Steele <david@pgmasters.net>)
Ответы Re: pgsql: Exclude unlogged tables from base backups  (David Steele <david@pgmasters.net>)
Список pgsql-committers
David Steele <david@pgmasters.net> writes:
> On 3/25/18 3:22 PM, Tom Lane wrote:
>> Actually, that code didn't guarantee zero termination under *any*
>> circumstances; it only happened to work if the stack contained
>> zeroes to start with.

> Interesting.  strncpy() says it will pad the destination with NULLs when
> src is less than the size provided.  Perhaps some compilers don't honor
> that?

Yeah, but the "size provided" was the number of characters to be copied
from the source string, not the size of the destination buffer.  So
strncpy didn't think it needed to add any nulls.  There's a reason why
that function is widely disliked --- it's hard to use it in a safe way.

            regards, tom lane


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

Предыдущее
От: David Steele
Дата:
Сообщение: Re: pgsql: Exclude unlogged tables from base backups
Следующее
От: David Steele
Дата:
Сообщение: Re: pgsql: Exclude unlogged tables from base backups