Re: [PATCH] Teach pg_waldump to extract FPIs from the WAL

Поиск
Список
Период
Сортировка
От Justin Pryzby
Тема Re: [PATCH] Teach pg_waldump to extract FPIs from the WAL
Дата
Msg-id 20221226203903.GT1153@telsasoft.com
обсуждение исходный текст
Ответ на Re: [PATCH] Teach pg_waldump to extract FPIs from the WAL  (Michael Paquier <michael@paquier.xyz>)
Ответы Re: [PATCH] Teach pg_waldump to extract FPIs from the WAL  (Michael Paquier <michael@paquier.xyz>)
Список pgsql-hackers
On Mon, Dec 26, 2022 at 04:28:52PM +0900, Michael Paquier wrote:
> Comments?

> +        file = fopen(filename, PG_BINARY_W);
> +        if (!file)
> +            pg_fatal("could not open file \"%s\": %m", filename);
> +
> +        if (fwrite(page, BLCKSZ, 1, file) != 1)
> +            pg_fatal("could not write file \"%s\": %m", filename);
> +
> +        fclose(file);

fclose() should be tested, too:

> +        if (fwrite(page, BLCKSZ, 1, file) != 1 || fclose(file) != 0)
> +            pg_fatal("could not write file \"%s\": %m", filename);

-- 
Justin



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

Предыдущее
От: David Christensen
Дата:
Сообщение: Re: [PATCH] Teach pg_waldump to extract FPIs from the WAL
Следующее
От: Peter Geoghegan
Дата:
Сообщение: Re: New strategies for freezing, advancing relfrozenxid early