Re: CREATE DATABASE with filesystem cloning

Поиск
Список
Период
Сортировка
От Ranier Vilela
Тема Re: CREATE DATABASE with filesystem cloning
Дата
Msg-id CAEudQAowFaOJfBw_=+f1QLvOKE5F4sMNdFPuiuuyyNWXGik6bA@mail.gmail.com
обсуждение исходный текст
Ответ на CREATE DATABASE with filesystem cloning  (Thomas Munro <thomas.munro@gmail.com>)
Список pgsql-hackers
Hi,

Nazir Bilal Yavuz <byavuz81(at)gmail(dot)com> wrote:

>Any kind of feedback would be appreciated.

I know it's coming from copy-and-paste, but
I believe the flags could be:
- dstfd = OpenTransientFile(tofile, O_RDWR | O_CREAT | O_EXCL | PG_BINARY);
+ dstfd = OpenTransientFile(tofile, O_CREAT | O_WRONLY | O_TRUNC | O_EXCL | PG_BINARY);

The flags:
O_WRONLY | O_TRUNC
Allow the OS to make some optimizations, if you deem it possible.

The flag O_RDWR indicates that the file can be read, which is not true in this case. 
The destination file will just be written.

best regards,
Ranier Vilela

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

Предыдущее
От: Michail Nikolaev
Дата:
Сообщение: Re: Revisiting {CREATE INDEX, REINDEX} CONCURRENTLY improvements
Следующее
От: Robert Haas
Дата:
Сообщение: Re: WHERE CURRENT OF with RLS quals that are ctid conditions