Open source software is increasingly becoming available on the mainframe(IBM z/LinuxONE). PostgreSQL, also known as Postgres, is a free and open-source relational database management system emphasizing extensibility and SQL compliance.
There are benefits running Postgres, the features is aimed to help developers build applications, administrators to protect data integrity and build fault-tolerant environments, and help you manage data no matter how big or small the dataset. In this tutorial, we’ll be using Rhel 8 and Sles 15, which are popular Linux Platform compatible to LinuxONE machine. Some steps might be little different if you are using different architecture
- Request access to LinuxONE Community Cloud. Follow instructions here
1.3 Install postgresql
For RHEL:
# sudo yum install postgresql-server
For SLES:
# sudo zypper install postgresql-server
2.1 Start postgresql service
# sudo system start postgresql.service
2.2 Enable postgres
# sudo system enable postgresql.service
2.3 Check status of the postgresql server
# sudo systemctl status postgresql.service
Optional - Output should look like this
3.1 Change the user to default postgres user
# sudo su - postgres
3.2 Enter command "psql" to get to postgresql command line
# psql
3.3 Check connection
# \conninfo
3.4 Check postgres version
# SELECT VERSION();
4.1 Create a table called persons
# CREATE TABLE persons;
4.2 Check the table data
# SELECT * FROM persons;
4.3 Insert data into the table
# INSERT INTO persons(fname,lname,email) VALUES('elvin', 'maditsi', 'elvin@postgres.com');
4.4 List data on table
# SELECT * FROM persons;