본문 바로가기
아이티 공부/PostgreSQL

PostgreSQL 에러, initializing pg_authid ... FATAL: wrong number of index expressions

by Klero 2018. 8. 21.
반응형
PostgreSQL 에러, initializing pg_authid ... FATAL:  wrong number of index expressions


테스트 환경 : 

OS - CentOS 7.4 64Bit Minimal

PostgreSQL - postgresql-9.0.0.tar




단지 이 글은 아래 에러가 발생했을 때의 해결 방법에 대한 내용입니다.

왜 이런 에러가 발생했는지에 대한 자세한 설명은 구글 검색을 해보시길 바라겠습니다.


CentOS 7.4 최소버전에 PostgreSQL을 위해 필요한 패키지 파일들을 설치하고

postgreSQL 9.0.0 소스 파일을 컴파일 하고 initdb로 데이터 디렉토리를 설정하려고 했는데

아래와 같은 에러가 발생했습니다.


initializing pg_authid ... FATAL:  wrong number of index expressions

STATEMENT:  REVOKE ALL on pg_authid FROM public;



[postgres@Centos7 postgresql-9.0.0]$ /home/postgres/pgsql/bin/initdb -E utf-8 -/home/postgres/pgsql/data
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 text search configuration will be set to "english".
 
fixing permissions on existing directory /home/postgres/pgsql/data ... ok
creating subdirectories ... ok
selecting default max_connections ... 100
selecting default shared_buffers ... 32MB
creating configuration files ... ok
creating template1 database in /home/postgres/pgsql/data/base/1 ... ok
initializing pg_authid ... FATAL:  wrong number of index expressions
STATEMENT:  REVOKE ALL on pg_authid FROM public;
 
child process exited with exit code 1
initdb: removing contents of data directory "/home/postgres/pgsql/data"
 


yum 명령어를 통해 필요한 패키지 파일들을 추가로 설치합니다.



[root@Centos7 ~]# yum install -y build-essential libreadline-dev zlib1g-dev flex bison libxml2-dev libxslt-dev libssl-dev
[root@Centos7 ~]# yum install -y clang


아래의 명령어를 수행합니다.

정확하게는 모르겠지만 컴파일러 버그로 추정된다고 합니다.

최신의 gcc 패캐지를 설치 또는 업데이트 한 다음 아래에서 CFLAGS="-01" 인수로 사용하면 다시 컴파일이 가능합니다.

제 생각에는 CFLAGS="-01" 인수를 사용하여 구버전의 gcc에서 작동하지 못하게 만드는 것 같습니다.



[postgres@Centos7 postgresql-9.0.0]$ ./configure CFLAGS="-O1" CC=clang \
--prefix=/home/postgres/pgsql --enable-depend --enable-nls=utf-8 --with-python



이제 make 및 make install 명령어를 통해 설치합니다.

그리고 다시 initdb 명령어를 통해 데이터 디렉토리를 설정합니다.

이제는 정상적으로 PostgreSQL이 설정된 것을 볼 수 있습니다.



[postgres@Centos7 postgresql-9.0.0]$ /home/postgres/pgsql/bin/initdb -E utf-8 -/home/postgres/pgsql/data
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 text search configuration will be set to "english".
 
fixing permissions on existing directory /home/postgres/pgsql/data ... ok
creating subdirectories ... ok
selecting default max_connections ... 100
selecting default shared_buffers ... 32MB
creating configuration files ... ok
creating template1 database in /home/postgres/pgsql/data/base/1 ... ok
initializing pg_authid ... ok
initializing dependencies ... ok
creating system views ... ok
loading system objects descriptions ... ok
creating conversions ... ok
creating dictionaries ... ok
setting privileges on built-in objects ... ok
creating information schema ... ok
loading PL/pgSQL server-side language ... ok
vacuuming database template1 ... ok
copying template1 to template0 ... ok
copying template1 to postgres ... ok
 
WARNING: enabling "trust" authentication for local connections
You can change this by editing pg_hba.conf or using the -A option the
next time you run initdb.
 
Success. You can now start the database server using:
 
    /home/postgres/pgsql/bin/postgres -/home/postgres/pgsql/data
or
    /home/postgres/pgsql/bin/pg_ctl -/home/postgres/pgsql/data -l logfile start
 
 



이 글이 꼭 도움이 되셨으면 좋겠습니다. 감사합니다.



댓글