Main Tutorials

How to install postgresql in fedora core

Here i share how i install postgresql in fedora core. I spent full day to find out a solution. Hope this help

1) First please get a PostgeSQL source code n compile it for installation or using yum command in fedora core.

a) Regarding PostgeSQL source code Compilation, please visit here
https://mkyong.com/database/how-to-compile-postgresql-database-source-code-in-linux/

b) Regarding Yum command, change to root and issue following command, it will connect to internet and download postgresql core files.

yum -y install postgresql postgresql-server php-pgsql 

install-postgres-in-fedora-step1

2) Create a database cluster with initdb -D /usr/local/pgsql/data command, before that please create a /usr/local/pgsql/data folder and assign ‘postgres’ user to own it. ‘postgres’ is the default user for postgresql.

mkdir /usr/local/pgsql/data
chown postgres /usr/local/pgsql/data
su - postgres
initdb -D /usr/local/pgsql/data

install-postgres-in-fedora-step2

3) Start postgresql server

pg_ctl /usr/local/pgsql/data -l -logfile start

if you want stop postgres server , please issue following command.

pg_ctl /usr/local/pgsql/data -l -logfile stop

4)Create a database

createdb new_db

5)Access with psql

psql new_db

6) Issue a select version(); command, if it show postgresql version, it’s means you are successfully installed postgresql in fedora already.

install-postgres-in-fedora-step3

About Author

author image
Founder of Mkyong.com, love Java and open source stuff. Follow him on Twitter. If you like my tutorials, consider make a donation to these charities.

Comments

Subscribe
Notify of
10 Comments
Most Voted
Newest Oldest
Inline Feedbacks
View all comments
techiswell
11 years ago

su – postgres

is erroring, as postgres user is not created. what to do to solve the same?

Michi
10 years ago
Reply to  techiswell

You have to use “sudo su – postgres”

Chris
12 years ago

Your Spring tutorials have saved me at work, and now youve helped me with a personal project.
Many Many thanks

Blake
12 years ago

Your step #3 is missing the “-D” before the file path. It’s listed in your screenshot, but not your text.

Thanks for the write-up

negativeØne
13 years ago

Great article! Good job!

andrew
14 years ago

Very helpful. thanks.

andreas
14 years ago

Thanks a lot ….

chidveer
14 years ago

THANXXXXXXXXXXXXXXXXXXXX

A LOTTTTTTTTTTTT…………………..

Naruto Shippuden Music Download
15 years ago

Hi there Expert, I fell lucky that I located this post while browsing for naruto shippuden music download. I am with you on the topic of nnial 2007 – salvatore iaconesi – del.icio.us poetry. Ironically, I was just putting a lot of thought into this last Thursday.