How to install PostgreSQL on CentOS
Maybe you've seen one of the articles out there comparing PostgreSQL, MySQL and other database architectures, and you want to compare things yourself. Or maybe you know you're using PostgreSQL for a project. Either way, you need to get the server up and running. Here's how to get a PostgreSQL server started on top of CentOS.
DIFFICULTY | Basic - 1 | Medium - 2 | Advanced - 3 |
TIME REQUIRED | 15 min |
RELATED PRODUCTS | CentOS-based VPS or dedicated servers |
RECIPE
Install PostgreSQL
Install the server
Initialize the database
The system should return "Initializing database [ok]."
Check the configuration and start the service
service postgresql start
PostgreSQL creates a user called "postgres" which accesses the database functions. You'll need to switch to that user to make sure things are all up and running correctly.
You should now be logged in as the postgres user.
Connect to the database
You should now be at a PostgreSQL prompt which looks like this "postgres=#"
Success!
If you've gotten to the prompt above, PostgreSQL is up and running successfully. You can type \q
to quit out of the PostgreSQL prompt
Note: As a courtesy, we provide information about how to use certain third-party products, but we do not endorse or directly support third-party products and we are not responsible for the functions or reliability of such products. Third-party marks and logos are registered trademarks of their respective owners. All rights reserved.