PostgreSQL

PostgreSQL is an open-source, object-relational database management system with a long history of development and a reputation for reliability, data integrity, and correctness. It can be used on a variety of operating systems, including Linux, UNIX, and Windows.

PostgreSQL is not controlled by any corporation or other private entity and the source code is available free of charge. Latest release as of time of writing is PostgreSQL14.

Key Features in PostgreSQL

PostgreSQL is compatible with a variety of operating systems, including Linux, UNIX, and Windows. It can handle a range of data types, including text, images, sounds, and video, and offers programming interfaces in languages such as C/C++, Java, Perl, Python, Ruby, Tcl, and ODBC.

PostgreSQL supports a large part of the SQL standard and offers features including following −

  • Complex SQL queries
  • SQL Sub-selects
  • Foreign keys
  • Trigger
  • Views
  • Transactions
  • Multiversion concurrency control (MVCC)
  • Streaming Replication
  • Hot Standby

You can check PostgreSQL official documentation here to understand the above features.

PostgreSQL can be extended by the user in many ways. For example by adding new −

  • Data types
  • Functions
  • Operators
  • Aggregate functions
  • Index methods

PostgreSQL as a service on Doprax Cloud Platform

On Doprax, you can add PostgreSQL service to your project. Before that though you have to:

  • Sign up and Sign in to Doprax cloud platform
  • Connect your GitHub account
  • Create New App and either import code from App Market or from your Github.

If you have done the above already, head over to the Services section and click on the Add a Service button.

After clicking the Add a service button, a page showing the different services Doprax offers appears. Pick PostgreSQL and click the Add button.

The first image above shows that default Doprax persists Postgres data by mounting to /var/lib/postgresql/data to prevent data loss in case the app is restarted. By ticking the checkbox, you can decide if you want it to persist.

Also, Environment Variables such as the Name of the Database(POSTGRES_DB), password of the database(POSTGRES_PASSWORD), and Postgres user(POSTGRES_USER) need to be set. In the second image, it is seen that I can edit what I have set by clicking the pencil sign in each of the environment variables.

Above, you can see that the name of the database (POSTGRES_DB) is set to testDB.

So, if you allowed persisting of Postgres data, head to the Volumes section, and you will see a Postgres volume mounted to /var/lib/postgresql/data.

So anything that is being stored in your PostgreSQL database in your app will be persisted.

Please do tell us, did you find the content above helpful?