Re: Postgresql13_beta1 (could not rename temporary statistics file)Windows 64bits

Поиск
Список
Период
Сортировка
От Ranier Vilela
Тема Re: Postgresql13_beta1 (could not rename temporary statistics file)Windows 64bits
Дата
Msg-id CAEudQApt2PbW5BZn1e_fnoT2hm574vj-R+jA4BT3p3w6zS6eSw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Postgresql13_beta1 (could not rename temporary statistics file)Windows 64bits  (Ranier Vilela <ranier.vf@gmail.com>)
Ответы Re: Postgresql13_beta1 (could not rename temporary statistics file)Windows 64bits  (Justin Pryzby <pryzby@telsasoft.com>)
Список pgsql-hackers
I can confirm that the problem is in pgrename (dirmod.c),
something is not OK, with MoveFileEx, even with the (MOVEFILE_REPLACE_EXISTING) flag.

Replacing MoveFileEx, with
unlink (to);
rename (from, to);

#if defined (WIN32) &&! defined (__ CYGWIN__)
unlink(to);
while (rename (from, to)! = 0)
#else
while (rename (from, to) <0)
#endif

The log messages have disappeared.

I suspect that if the target (to) file exists, MoveFileEx, it is failing to rename, even with the flag enabled.

Windows have the native rename function (https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/rename-wrename?view=vs-2019)
However, it fails if the target (to) file exists.

Question, is it acceptable delete the target file, if it exists, to guarantee the rename?

regards,
Ranier Vilela

Вложения

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

Предыдущее
От: Jeff Davis
Дата:
Сообщение: Re: hashagg slowdown due to spill changes
Следующее
От: Kyotaro Horiguchi
Дата:
Сообщение: Re: Review for GetWALAvailability()