Skip to main content

10. Postgresql


PostgreSQL

  • Open source object-relational Database Management System(ORDBMS) that provides an implementation of the SQL querying language.

  • Object-Oriented (Classes, inheritance)

  • Featured Transaction Properties: ACID properties.

  • having many advanced features like reliable transactions and concurrency without reading locks.

  • Manages Concurrency

  • RDBMS with client-server Architecture.

  • Uses process per-user client/server Model. => Each user is granted/given a process that will remain alive till the user closes the connection.

  • Programs run by the client connects to server instance & requests read and write operations.

  • Relations = Table

  • Tuple = Row

  • Attribute = Column

  • Default Port of PostgreSQL = 5432

  • By Default Postgresql creates a database `Postgres

  • Any select, insert, update, or delete to the data is done in the shared buffer area. The data is then written to data files located on a physical disk through background writer processes.

Installation on Linux

After Installation

  • We got a command line Utility - psql.
    • Open terminal and enter psql
    • if not try sudo -i -u postgres then psql (this is switching over to the Postgres account on your server).
    • try \l command

Commands

CommandDescription
\lprints all databases list
\qto quit
createuser --interactivecreating new role
createdb newdbcreating a new database with name newdb