Re: BUG #8160: 9.3 Beta 1 Initdb doesn't work - Mailing list pgsql-bugs

From Heikki Linnakangas
Subject Re: BUG #8160: 9.3 Beta 1 Initdb doesn't work
Date
Msg-id 51925CF9.5000809@vmware.com
Whole thread Raw
In response to BUG #8160: 9.3 Beta 1 Initdb doesn't work  (bnicholson@hp.com)
Responses Re: BUG #8160: 9.3 Beta 1 Initdb doesn't work  (Devrim GÜNDÜZ <devrim@gunduz.org>)
List pgsql-bugs
On 14.05.2013 16:48, bnicholson@hp.com wrote:
> I've installed the 9.3 beta 1 packages (via pgdg repo and yum) and when I
> try to do an initdb it fails. /var/lib/pgsql/9.3/data has nothing in it when
> I attempt the initdb :
>
> #service postgresql-9.3 initdb
> Initializing database:[FAILED]
>
> # cat /var/lib/pgsql/9.3/pgstartup.log
> The files belonging to this database system will be owned by user
> "postgres".
> This user must also own the server process.
>
> The database cluster will be initialized with locale "en_US.UTF-8".
> The default database encoding has accordingly been set to "UTF8".
> The default text search configuration will be set to "english".
> Data page checksums are disabled.
>
> fixing permissions on existing directory /var/lib/pgsql/9.3/data ... ok
> creating directory /var/lib/pgsql/9.3/data/pg_xlog ... ok
> initdb: could not create symbolic link "/var/lib/pgsql/9.3/data/pg_xlog":
> File exists

There seems to be a bug in the init script. If you don't give a location
for pg_xlog on the command line, it uses $PGDATA/pg_xlog, which confuses
initdb:

>  # If the xlog directory is specified just after the locale parameter, use it:
>  if [ -z $INITDBXLOGDIR ]
>  then
>      INITDBXLOGSTRING=`echo $PGDATA/pg_xlog`
>  else
>      INITDBXLOGSTRING=`echo $INITDBXLOGDIR`
>  fi
 > ...
>  # Initialize the database
>  $SU -l postgres -c "$PGENGINE/initdb --pgdata='$PGDATA' --xlogdir=$INITDBXLOGSTRING --auth='ident' $LOCALESTRING" >>
"$PGLOG"2>&1 < /dev/null 

Seems that if INITDBXLOGDIR is not given, it should just leave out
--xlogdir. Devrim?

- Heikki

pgsql-bugs by date:

Previous
From: csibe1985.12@freemail.hu
Date:
Subject: BUG #8159: PostgreSQlk is not working
Next
From: Devrim GÜNDÜZ
Date:
Subject: Re: BUG #8160: 9.3 Beta 1 Initdb doesn't work