Обсуждение: initdb fails at initializing pg_shadow

Поиск
Список
Период
Сортировка

initdb fails at initializing pg_shadow

От
Joerg Brandt
Дата:
Is the following a bug or my mistake -- any hints?

The system:
$ uname -a
SunOS euklid 5.8 Generic_108528-03 sun4u sparc SUNW,Ultra-4

The user:
$ id
uid=440(postgres) gid=177(postgres)

The problem:
$ initdb -D /export/home/data/postgres -d
Running with debug mode on.

Initdb variables:
  PGDATA=/export/home/data/postgres
  datadir=/opt/pgsql/share
  PGPATH=/opt/pgsql/bin
  TEMPFILE=/tmp/initdb.11243
  MULTIBYTE=
  MULTIBYTEID=0
  POSTGRES_SUPERUSERNAME=postgres
  POSTGRES_SUPERUSERID=440
  TEMPLATE1_BKI=/opt/pgsql/share/template1.bki
  GLOBAL_BKI=/opt/pgsql/share/global.bki
  TEMPLATE1_DESCR=/opt/pgsql/share/template1.description
  GLOBAL_DESCR=/opt/pgsql/share/global.description
  POSTGRESQL_CONF_SAMPLE=/opt/pgsql/share/postgresql.conf.sample
  PG_HBA_SAMPLE=/opt/pgsql/share/pg_hba.conf.sample
  PG_IDENT_SAMPLE=/opt/pgsql/share/pg_ident.conf.sample
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 existing directory /export/home/data/postgres
Creating directory /export/home/data/postgres/base
Creating directory /export/home/data/postgres/global
Creating directory /export/home/data/postgres/pg_xlog
Creating template1 database in /export/home/data/postgres/base/1
Running: /opt/pgsql/bin/postgres -boot -x1 -C -F -D/export/home/data/postgres -d template1
DEBUG:  database system was shut down at 2001-05-10 16:21:22 MEST
DEBUG:  CheckPoint record at (0, 8)
DEBUG:  Redo record at (0, 8); Undo record at (0, 8); Shutdown TRUE
DEBUG:  NextTransactionId: 514; NextOid: 16384
DEBUG:  database system is in production state
Creating global relations in /export/home/data/postgres/global
Running: /opt/pgsql/bin/postgres -boot -C -F -D/export/home/data/postgres -d template1
DEBUG:  database system was shut down at 2001-05-10 16:21:25 MEST
DEBUG:  CheckPoint record at (0, 72)
DEBUG:  Redo record at (0, 72); Undo record at (0, 0); Shutdown TRUE
DEBUG:  NextTransactionId: 514; NextOid: 16384
DEBUG:  database system is in production state
<datname name>
<datdba int4>
<encoding int4>
<datistemplate bool>
<datallowconn bool>
<datlastsysoid oid>
<datpath text>
> creating bootstrap relation
bootstrap relation created ok
> Commit End
tuple 1<Inserting value: 'template1'
Typ == NULL, typeindex = 3 idx = 0
template1 End InsertValue
Inserting value: '440'
Typ == NULL, typeindex = 6 idx = 1
440 End InsertValue
Inserting value: '0'
Typ == NULL, typeindex = 6 idx = 2
0 End InsertValue
Inserting value: 't'
Typ == NULL, typeindex = 0 idx = 3
t End InsertValue
Inserting value: 't'
Typ == NULL, typeindex = 0 idx = 4
t End InsertValue
Inserting value: '0'
Typ == NULL, typeindex = 9 idx = 5
0 End InsertValue
Inserting value: ''
Typ == NULL, typeindex = 8 idx = 6
 End InsertValue
Insert Begin
InsertOneTuple oid 1, 7 attrs
End InsertOneTuple, objectid=1
Insert End

> Transaction End
Amclose: relation (null).
> <varfoo oid>

> creating bootstrap relation
bootstrap relation created ok
> Commit End
Amclose: relation (null).
> <usename name>
<usesysid int4>
<usecreatedb bool>
<usetrace bool>
<usesuper bool>
<usecatupd bool>
<passwd text>
<valuntil int4>

> creating bootstrap relation
bootstrap relation created ok
> Commit End
tuple 0<Inserting value: 'postgres'
Typ == NULL, typeindex = 3 idx = 0
postgres End InsertValue
Inserting value: '440'
Typ == NULL, typeindex = 6 idx = 1
440 End InsertValue
Inserting value: 't'
Typ == NULL, typeindex = 0 idx = 2
t End InsertValue
Inserting value: 't'
Typ == NULL, typeindex = 0 idx = 3
t End InsertValue
Inserting value: 't'
Typ == NULL, typeindex = 0 idx = 4
t End InsertValue
Inserting value: 't'
Typ == NULL, typeindex = 0 idx = 5
t End InsertValue
Inserting null
Inserting null
Insert Begin
InsertOneTuple oid 0, 8 attrs
End InsertOneTuple, objectid=0
Insert End

> Transaction End
Amclose: relation (null).
> <groname name>
<grosysid int4>
<grolist _int4>

> creating bootstrap relation
bootstrap relation created ok
> Commit End
Amclose: relation (null).
> <logfoo oid>

> creating bootstrap relation
bootstrap relation created ok
> Commit End
Amclose: relation (null).
> Initializing pg_shadow.

initdb failed.
Removing temp file /tmp/initdb.11243.

--
Mit freundl. Gruss --- Best Regards
------------------------------------------------------------------------
Joerg Brandt c/o University of Bremen        | Phone: (+49)-421-218-9006
Mathemathics and Computer Science Dept.      | Fax:   (+49)-421-218-4863
PO Box 330440  D-28334 Bremen  Germany       | Telex: 0245811 unibr d
Local: Building MZH  Room 2390
System and network administrator for domain math.uni-bremen.de
------------------------------------------------------------------------
My PGP 2.6 key 2048/49847939 is available searching a public keyserver.
Key fingerprint = C9 CF 41 10 65 AA 2C 9F  07 36 30 FB 89 69 6D 5A.
========================================================================
UNIX _is_ user friendly - it's just selective about who its friends are!
========================================================================



Re: initdb fails at initializing pg_shadow

От
Tom Lane
Дата:
Joerg Brandt <jbrandt@math.uni-bremen.de> writes:
> Is the following a bug or my mistake -- any hints?

Looks like a problem all right ... which PG version is this exactly?

>> Initializing pg_shadow.

> initdb failed.
> Removing temp file /tmp/initdb.11243.

Unfortunately initdb shoves all the output from the later steps straight
to /dev/null, so you can't see what went wrong here.  Look in the initdb
script and remove the "-o /dev/null" from PGSQL_OPT and the >/dev/null
from the commands that set up pg_shadow, so that we can get more info.

            regards, tom lane

Re: initdb fails at initializing pg_shadow

От
Joerg Brandt
Дата:
> Joerg Brandt <jbrandt@math.uni-bremen.de> writes:
> > Is the following a bug or my mistake -- any hints?
>
> Looks like a problem all right ... which PG version is this exactly?
Sorry, i forgot. postgresql version is 7.1.1, configure options are:
--prefix=/opt/pgsql
--with-tcl
--with-openssl=/usr/lib/ssl
--with-CXX

>
> >> Initializing pg_shadow.
>
> > initdb failed.
> > Removing temp file /tmp/initdb.11243.
>
> Unfortunately initdb shoves all the output from the later steps straight
> to /dev/null, so you can't see what went wrong here.  Look in the initdb
> script and remove the "-o /dev/null" from PGSQL_OPT and the >/dev/null
> from the commands that set up pg_shadow, so that we can get more info.
>

Done. Now i get:
....
> Initializing pg_shadow.
DEBUG:  database system was shut down at 2001-05-11 10:17:52 MEST
DEBUG:  CheckPoint record at (0, 176)
DEBUG:  Redo record at (0, 176); Undo record at (0, 0); Shutdown TRUE
DEBUG:  NextTransactionId: 514; NextOid: 16385
DEBUG:  database system is in production state
FATAL 1:  cannot open pg_class: No such file or directory
DEBUG:  shutting down
DEBUG:  database system is shut down

initdb failed.
Removing temp file /tmp/initdb.17219.

There is no  pg_class file in my postgresql installation path.
Even in the sources i only found this:
$ find . -name '*pg_class*' -print
./src/include/catalog/pg_class.h

O yes, i did all the rtfm.

--
Mit freundl. Gruss --- Best Regards
------------------------------------------------------------------------
Joerg Brandt c/o University of Bremen        | Phone: (+49)-421-218-9006
Mathemathics and Computer Science Dept.      | Fax:   (+49)-421-218-4863
PO Box 330440  D-28334 Bremen  Germany       | Telex: 0245811 unibr d
Local: Building MZH  Room 2390
System and network administrator for domain math.uni-bremen.de
------------------------------------------------------------------------
My PGP 2.6 key 2048/49847939 is available searching a public keyserver.
Key fingerprint = C9 CF 41 10 65 AA 2C 9F  07 36 30 FB 89 69 6D 5A.
========================================================================
UNIX _is_ user friendly - it's just selective about who its friends are!
========================================================================



Re: initdb fails at initializing pg_shadow

От
Tom Lane
Дата:
Joerg Brandt <jbrandt@math.uni-bremen.de> writes:
> FATAL 1:  cannot open pg_class: No such file or directory

Curious.  Looking back at your previous trace, I realize that
the first invocation of postgres -boot (which should have created
pg_class) produced no debugging output except for the XLOG startup
messages.  With -d, there should have been reams of output.

I wonder whether something funny happened to your template1.bki file.
There should be about 2600 lines of stuff in it --- what do you actually
see there?  Also, you might want to go to pgsql/src/backend/catalog/ and
do "make clean; make template1.bki" to watch the creation of the file
more carefully; see if any error is reported.  The .bki files are built
using sed, awk, and a few other tools that maybe you have nonstandard
versions of.

            regards, tom lane