Re: Initdb failure - Mailing list pgsql-hackers

From vignesh C
Subject Re: Initdb failure
Date
Msg-id CALDaNm3LnwzY_5mFz8XFO6v6yTkmvjiHT+m0qO4SeXALAgy08Q@mail.gmail.com
Whole thread Raw
In response to Re: Initdb failure  (Rafia Sabih <rafia.pghackers@gmail.com>)
Responses Re: Initdb failure
List pgsql-hackers
On Thu, Jul 25, 2019 at 4:52 PM Rafia Sabih <rafia.pghackers@gmail.com> wrote:
>
> On Thu, 25 Jul 2019 at 07:39, vignesh C <vignesh21@gmail.com> wrote:
> >
> > Hi,
> >
> > Initdb fails when following path is provided as input:
> >
datasadfasfdsafddsdatasadfasfdsafddsdatasadfasfdsafddsdatasadfasfdsafddsdatasadfasfdsafddsdatasadfasfdsafddsdatasadfasfdsafddsdatasadfasfdsafddsdatasadfasfdsafddsdatasadfasfdsafddsdatasadfasfdsafddsdatasadfasfdsafdds/datasadfasfdsafddsdatasadfasfdsafddsdatasadfasfdsafddsdatasadfasfdsafddsdatasadfasfdsafddsdatasadfasfdsafddsdatasadfasfdsafddsdatasadfasfdsafddsdatasadfasfdsafddsdatasadfasfdsafddsdatasadfasfdsafddsdatasadfasfdsafdds/datasadfasfdsafddsdatasadfasfdsafddsdatasadfasfdsafddsdatasadfasfdsafddsdatasadfasfdsafddsdatasadfasfdsafddsdatasadfasfdsafddsdatasadfasfdsafddsdatasadfasfdsafddsdatasadfasfdsafddsdatasadfasfdsafddsdatasadfasfdsafdds/datasadfasfdsafddsdatasadfasfdsafddsdatasadfasfdsafddsdatasadfasfdsafddsdatasadfasfdsafddsdatasadfasfdsafddsdatasadfasfdsafddsdatasadfasfdsafddsdatasadfasfdsafddsdatasadfasfdsafddsdatasadfasfdsafddsdatasadfasfdsafdds/datasadfasfdsafddsdatasadfasfdsafddsdatasadfasfdsafddsdatasadfasfdsafddsdatasadfasfdsafddsdatasadfasfdsafddsdatasadfasfdsafddsdatasadfasfdsafddsdatasadfasfdsafddsdatasadfasfdsafddsdatasadfasfdsafddsdatasadfasfdsafdds/datasadfasfdsafddsdatasadfasfdsafddsdatasadfasfdsafddsdatasadfasfdsafddsdatasadfasfdsafddsdatasadfasfdsafddsdatasadfasfdsafddsdatasadfasfdsafddsdatasadfasfdsafddsdatasadfasfdsafddsdatasadfasfdsafddsdatasadfasfdsafdds/
> >
> > Also the cleanup also tends to fail in the cleanup path.
> >
> > Could be something to do with path handling.
> This is because the value of MAXPGPATH is 1024 and the path you are
> providing is more than that. Hence, when it is trying to read
> PG_VERSION in ValidatePgVersion it is going to a wrong path with just
> 1024 characters.
>

The error occurs at a very later point after performing the initial
work like creating directory.  I'm thinking we should check this in
the beginning and throw the error message at the beginning and exit
cleanly.

>
> > I'm not sure if this is already known.
> I am also not sure if it is known or intentional. On the other hand I
> also don't know if it is practical to give such long names for
> database directory anyway.
>

Usually they will not be using such long path, but this is one of the
odd scenarios.

Regards,
Vignesh
EnterpriseDB: http://www.enterprisedb.com



pgsql-hackers by date:

Previous
From: Kyotaro Horiguchi
Date:
Subject: Re: Index Skip Scan
Next
From: Konstantin Knizhnik
Date:
Subject: Re: Built-in connection pooler