Thread: INIT DB FAILURE

INIT DB FAILURE

From
"Mike Miller"
Date:
I'll just quickly run down what I did and hopefully someone can help me out.

cd /usr/src/postgresql-7.0.3/src
./configure --prefix=/usr/pgsql
make
make install
mkdir /usr/pgsql/data
chown postgres /usr/pqsql/data
su - postgres
initdb -D /usr/pgsql/data

// I have placed initdb in the path, as well as already created the user
postgres.  There are NO existing versions of postgreSQL on this machine and
this is the first time I am installing it.

The error I get is as follows:
---
[postgres@ pgsql]$ initdb -D /usr/pgsql/data
This database system will be initialized with username "postgres".
This user will own all the data files and must also own the server process.

Fixing permissions on pre-existing data directory /usr/pgsql/data
Creating database system directory /usr/pgsql/data/base
Creating database XLOG directory /usr/pgsql/data/pg_xlog
Creating template database in /usr/pgsql/data/base/template1
ERROR:  Error: unknown type 'ame'.

ERROR:  Error: unknown type 'ame'.

Creating global relations in /usr/pgsql/data/base
ERROR:  Error: unknown type 'ame'.

ERROR:  Error: unknown type 'ame'.

Adding template1 database to pg_database
/usr/pgsql/bin/initdb: line 481: 20412 Segmentation fault
"$PGPATH"/postgres $BACKENDARGS template1 <"$TEMPFILE"

initdb failed.
Removing /usr/pgsql/data.
Removing temp file /tmp/initdb.20382.
---

There has to be some sort of logical explaination for this.  I am running
Linux-2.2.x

Any help would be appreciated.

--
Mike
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.


Re: INIT DB FAILURE

From
Tom Lane
Date:
"Mike Miller" <temp6453@hotmail.com> writes:
> Fixing permissions on pre-existing data directory /usr/pgsql/data
> Creating database system directory /usr/pgsql/data/base
> Creating database XLOG directory /usr/pgsql/data/pg_xlog
> Creating template database in /usr/pgsql/data/base/template1
> ERROR:  Error: unknown type 'ame'.

> ERROR:  Error: unknown type 'ame'.

> Creating global relations in /usr/pgsql/data/base

Now that I look, there is a similar report in the pgsql-bugs archives
from last August, but no information about any resolution.

Please try the initdb with --debug added, and send me the resulting
output (it'll probably be kinda bulky, so don't send to the list).

            regards, tom lane

Re: INIT DB FAILURE

From
"Mike Miller"
Date:
mv global.bki global.bki.old; mv template1.bki template1.bki.old
cat global.bki.old | sed s/" ame"/" name"/ > global.bki
cat template1.bki.old | sed s/" ame"/" name"/ > global.bki

Solution is pretty simple actually (did figure this one out).  I did find
other people complaining about this, but no solutions.  But I just did the
install on an older slackware system and diffed the bki files to find some
as 'ame' and others as 'name' - so I used the lines above and managed to get
it to work just fine.  Quite odd really... I am using the latest stable
versions of all of the GNU tools straight from their site.

Problem appears to be solved though, but maybe a check in the Makefile is in
order.  It seems (through my google search, as well as a search of this
archive) that I am not the only one with this problem.

Cheers;
--
Mike


>From: Tom Lane <tgl@sss.pgh.pa.us>
>To: "Mike Miller" <temp6453@hotmail.com>
>CC: pgsql-general@postgresql.org
>Subject: Re: INIT DB FAILURE
>Date: Tue, 16 Jan 2001 13:18:04 -0500
>
>"Mike Miller" <temp6453@hotmail.com> writes:
> > Fixing permissions on pre-existing data directory /usr/pgsql/data
> > Creating database system directory /usr/pgsql/data/base
> > Creating database XLOG directory /usr/pgsql/data/pg_xlog
> > Creating template database in /usr/pgsql/data/base/template1
> > ERROR:  Error: unknown type 'ame'.
>
> > ERROR:  Error: unknown type 'ame'.
>
> > Creating global relations in /usr/pgsql/data/base
>
>Now that I look, there is a similar report in the pgsql-bugs archives
>from last August, but no information about any resolution.
>
>Please try the initdb with --debug added, and send me the resulting
>output (it'll probably be kinda bulky, so don't send to the list).
>
>            regards, tom lane

_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.


Re: Re: INIT DB FAILURE

From
Tom Lane
Date:
"Mike Miller" <temp6453@hotmail.com> writes:
> mv global.bki global.bki.old; mv template1.bki template1.bki.old
> cat global.bki.old | sed s/" ame"/" name"/ > global.bki
> cat template1.bki.old | sed s/" ame"/" name"/ > global.bki

> Solution is pretty simple actually (did figure this one out).  I did find
> other people complaining about this, but no solutions.  But I just did the
> install on an older slackware system and diffed the bki files to find some
> as 'ame' and others as 'name' - so I used the lines above and managed to get
> it to work just fine.

OK, so the breakage is not in the bootstrap parser but in the generation
of the .bki files.  This is done by the shell script
src/backend/catalog/genbki.sh, and in looking it over, I notice with
suspicion the step

sed -e "s/;[     ]*$//g" \
    -e "s/^[     ]*//" \
    -e "s/[     ]Oid/\ oid/g" \
    -e "s/[     ]NameData/\ name/g" \
    -e "s/^Oid/oid/g" \
    -e "s/^NameData/\name/g" \
    -e "s/(NameData/(name/g" \
    -e "s/(Oid/(oid/g" \
    -e "s/NAMEDATALEN/$NAMEDATALEN/g" \
    -e "s/INDEX_MAX_KEYS\*2/$INDEXMAXKEYS2/g" \
    -e "s/INDEX_MAX_KEYS\*4/$INDEXMAXKEYS4/g" \
    -e "s/INDEX_MAX_KEYS/$INDEXMAXKEYS/g" \
    -e "s/FUNC_MAX_ARGS\*2/$INDEXMAXKEYS2/g" \
    -e "s/FUNC_MAX_ARGS\*4/$INDEXMAXKEYS4/g" \
    -e "s/FUNC_MAX_ARGS/$INDEXMAXKEYS/g" \
| $AWK '

In particular that "\name" looks pretty bogus.  Would you try removing
that backslash and see if the script works then?  I'll betcha that some
versions of sed convert the \n to a newline ...

BTW, what version of sed do you have, exactly?

            regards, tom lane

Re: Re: INIT DB FAILURE

From
"Mike Miller"
Date:
GNU sed version 3.02.80


>From: Tom Lane <tgl@sss.pgh.pa.us>
>To: "Mike Miller" <temp6453@hotmail.com>
>CC: pgsql-general@postgresql.org, pgsql-hackers@postgresql.org
>Subject: Re: Re: INIT DB FAILURE
>Date: Tue, 16 Jan 2001 16:21:31 -0500
>
>"Mike Miller" <temp6453@hotmail.com> writes:
> > mv global.bki global.bki.old; mv template1.bki template1.bki.old
> > cat global.bki.old | sed s/" ame"/" name"/ > global.bki
> > cat template1.bki.old | sed s/" ame"/" name"/ > global.bki
>
> > Solution is pretty simple actually (did figure this one out).  I did
>find
> > other people complaining about this, but no solutions.  But I just did
>the
> > install on an older slackware system and diffed the bki files to find
>some
> > as 'ame' and others as 'name' - so I used the lines above and managed to
>get
> > it to work just fine.
>
>OK, so the breakage is not in the bootstrap parser but in the generation
>of the .bki files.  This is done by the shell script
>src/backend/catalog/genbki.sh, and in looking it over, I notice with
>suspicion the step
>
>sed -e "s/;[     ]*$//g" \
>     -e "s/^[     ]*//" \
>     -e "s/[     ]Oid/\ oid/g" \
>     -e "s/[     ]NameData/\ name/g" \
>     -e "s/^Oid/oid/g" \
>     -e "s/^NameData/\name/g" \
>     -e "s/(NameData/(name/g" \
>     -e "s/(Oid/(oid/g" \
>     -e "s/NAMEDATALEN/$NAMEDATALEN/g" \
>     -e "s/INDEX_MAX_KEYS\*2/$INDEXMAXKEYS2/g" \
>     -e "s/INDEX_MAX_KEYS\*4/$INDEXMAXKEYS4/g" \
>     -e "s/INDEX_MAX_KEYS/$INDEXMAXKEYS/g" \
>     -e "s/FUNC_MAX_ARGS\*2/$INDEXMAXKEYS2/g" \
>     -e "s/FUNC_MAX_ARGS\*4/$INDEXMAXKEYS4/g" \
>     -e "s/FUNC_MAX_ARGS/$INDEXMAXKEYS/g" \
>| $AWK '
>
>In particular that "\name" looks pretty bogus.  Would you try removing
>that backslash and see if the script works then?  I'll betcha that some
>versions of sed convert the \n to a newline ...
>
>BTW, what version of sed do you have, exactly?
>
>            regards, tom lane

_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.