Re: [Win32] Problem with rename()

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [Win32] Problem with rename()
Дата
Msg-id 13419.1145373488@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: [Win32] Problem with rename()  ("Magnus Hagander" <mha@sollentuna.net>)
Список pgsql-bugs
"Magnus Hagander" <mha@sollentuna.net> writes:
> Looking at our code, we have the comment:
>     /* These flags allow concurrent rename/unlink */
>                     (FILE_SHARE_READ |
> FILE_SHARE_WRITE | FILE_SHARE_DELETE),

> But I'm not sure that those flags actually guarantee that. They do allow
> concurrent unlink, but not necessarily rename. I read elsewhere that it
> should work, but can't find backing docs on MSDN. Seems it works in most
> cases, but perhaps there are some where it doesn't?

I think there are two different cases involved in rename:

1. Someone has a handle for the file-to-be-renamed;
2. Someone has a handle for the file that is to be deleted (ie currently
   has the name being renamed to).

If #2 doesn't work then we've got serious problems.  I think though that
#1 can only occur in the context of WAL segment recycling, so we can
probably work around it if that doesn't work.

            regards, tom lane

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [Win32] Problem with rename()
Следующее
От: "Ed L."
Дата:
Сообщение: pre-existing shared memory block