Question : I get this error when starting postgresql server on fedora 16
[pirat9@Fedora16 forum]$ sudo service postgresql initdb Output Redirecting to /bin/systemctl initdb postgresql.service Unknown operation initdb
Solution:
Use the following commands to correct the issue:
[root@Fedora16 ~]# su - postgres -c "PGDATA=/var/lib/pgsql/data initdb" Output 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". fixing permissions on existing directory /var/lib/pgsql/data ... ok creating subdirectories ... ok selecting default max_connections ... 100 selecting default shared_buffers ... 24MB creating configuration files ... ok creating template1 database in /var/lib/pgsql/data/base/1 ... ok initializing pg_authid ... ok initializing dependencies ... ok creating system views ... ok loading system objects' descriptions ... ok creating collations ... 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: postgres -D /var/lib/pgsql/data or pg_ctl -D /var/lib/pgsql/data -l logfile start [root@Fedora16 ~]#
Start the Server now
[root@Fedora16 ~]# service postgresql start Output Redirecting to /bin/systemctl start postgresql.service
[root@Fedora16 ~]# ps -ef | grep sql Output postgres 3045 1 1 22:03 ? 00:00:00 /usr/bin/postgres -D /var/lib/pgsql/data -p 5432 postgres 3046 3045 0 22:03 ? 00:00:00 postgres: logger process postgres 3048 3045 0 22:03 ? 00:00:00 postgres: writer process postgres 3049 3045 0 22:03 ? 00:00:00 postgres: wal writer process postgres 3050 3045 0 22:03 ? 00:00:00 postgres: autovacuum launcher process postgres 3051 3045 0 22:03 ? 00:00:00 postgres: stats collector process root 3186 2874 0 22:04 pts/0 00:00:00 grep --color=auto post
ENJOY