Re: Add contrib/pg_logicalsnapinspect

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: Add contrib/pg_logicalsnapinspect
Дата
Msg-id 6dd0f118-ce86-4b98-af2c-1319e1593a15@eisentraut.org
обсуждение исходный текст
Ответ на Re: Add contrib/pg_logicalsnapinspect  (shveta malik <shveta.malik@gmail.com>)
Список pgsql-hackers
Is there a reason for this elaborate error handling:

+    fd = OpenTransientFile(path, O_RDONLY | PG_BINARY);
+
+    if (fd < 0 && errno == ENOENT)
+        ereport(ERROR,
+                errmsg("file \"%s\" does not exist", path));
+    else if (fd < 0)
+        ereport(ERROR,
+                (errcode_for_file_access(),
+                 errmsg("could not open file \"%s\": %m", path)));

Couldn't you just use the second branch for all errno's?



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