Re: initdb fails to initialize data directory

From: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
To: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, Nikhil Sontakke <nikhils(at)2ndquadrant(dot)com>
Cc: PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: initdb fails to initialize data directory
Date: 2018-04-19 19:15:30
Message-ID: ed0e5651-a2ba-1ad7-cb86-0e8a68116e60@iki.fi
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 19/04/18 09:38, Alvaro Herrera wrote:
> Nikhil Sontakke wrote:
>
>> Intrigued, on digging down further, this is happening because we are
>> not using a long enough buffer to accept the output of "postgres -V"
>> in the find_other_exec() function. In our case, we had used
>> --with-extra-version option with configure which caused the output of
>> "postgres -V" to go a little beyond the current "line" variable size.
>> This caused the strcmp to fail leading to initdb refusing to
>> initialize any data directories at all.
>
> Wow, that seems pretty silly nowadays.

Agreed.

Nitpick: using MAXPGPATH seems for the buffer size seems to wrong to me.
We're not storing a path here. MAXPGPATH is 1024 by default, which seems
fine, but I would've spelled it out directly as "line[1000]".

- Heikki

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2018-04-19 19:21:40 Re: ON CONFLICT DO UPDATE for partitioned tables
Previous Message Tom Lane 2018-04-19 19:01:24 Re: Built-in connection pooling