Re: pg_archivecleanup bug

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: pg_archivecleanup bug
Дата
Msg-id 20140319003001.GA16122@momjian.us
обсуждение исходный текст
Ответ на Re: pg_archivecleanup bug  (Heikki Linnakangas <hlinnakangas@vmware.com>)
Ответы Re: pg_archivecleanup bug  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: pg_archivecleanup bug  (Heikki Linnakangas <hlinnakangas@vmware.com>)
Список pgsql-hackers
On Tue, Mar 18, 2014 at 09:13:28PM +0200, Heikki Linnakangas wrote:
> On 03/18/2014 09:04 PM, Simon Riggs wrote:
> >On 18 March 2014 18:55, Alvaro Herrera <alvherre@2ndquadrant.com> wrote:
> >
> >>That said, I don't find comma expression to be particularly "not
> >>simple".
> >
> >Maybe, but we've not used it before anywhere in Postgres, so I don't
> >see a reason to start now. Especially since C is not the native
> >language of many people these days and people just won't understand
> >it.
>
> Agreed. The psqlODBC code is littered with comma expressions, and
> the first time I saw it, it took me a really long time to figure out
> what "if (foo = malloc(...), foo) { } " meant. And I consider myself
> quite experienced with C.

I can see how the comma syntax would be confusing, though it does the
job well.  Attached is a patch that does the double-errno.  However,
some of these loops are large, and there are 'continue' calls in there,
causing the addition of many new errno locations.  I am not totally
comfortable that this new coding layout will stay unbroken.

Would people accept?

    for (errno = 0; (dirent = readdir(dir)) != NULL; errno = 0)

That would keep the errno's together and avoid the 'continue' additions.

--
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + Everyone has their own god. +

Вложения

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

Предыдущее
От: Maxence Ahlouche
Дата:
Сообщение: GSoC application: MADlib k-medoids clustering
Следующее
От: Alexandr
Дата:
Сообщение: QSoC proposal: Rewrite pg_dump and pg_restore