Re: [PATCH] Make pg_basebackup configure and start standby [Review] - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: [PATCH] Make pg_basebackup configure and start standby [Review]
Date
Msg-id 20121121131944.GA4210@alvh.no-ip.org
Whole thread Raw
In response to Re: [PATCH] Make pg_basebackup configure and start standby [Review]  (Boszormenyi Zoltan <zb@cybertec.at>)
Responses Re: [PATCH] Make pg_basebackup configure and start standby [Review]  (Boszormenyi Zoltan <zb@cybertec.at>)
List pgsql-hackers
Boszormenyi Zoltan wrote:

> The problem is that it calls pg_malloc() which is an executable-specific
> function. Some of the bin/* executables define it as calling exit(1)
> when malloc() returns NULL, some call it with exit(EXIT_FAILURE)
> which happens to be 1 but still can be different from the constant 1.
> Some executables only define pg_malloc0() but not pg_malloc().

It seems simpler to have the escape_quotes utility function in port just
not use pg_malloc at all, have it return NULL or similar failure
indicator when malloc() fails, and then the caller decides what to do.

--
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services



pgsql-hackers by date:

Previous
From: Amit kapila
Date:
Subject: Re: [WIP PATCH] for Performance Improvement in Buffer Management
Next
From: Boszormenyi Zoltan
Date:
Subject: Re: [PATCH] Make pg_basebackup configure and start standby [Review]