Tuesday, May 26, 2020

PostgreSQL - Data Types

In this tutorial we will learn about of the commonly used data types in PostgreSQL.

About Data Types

Data types tells us about the type of data that is stored in a column.
Following are some of the commonly used data types in PostgreSQL.

Numeric Type

Numeric types helps us to store numbers. The following table lists the different numeric types.

Integer

These data types are used to store integer values like -2, 0, 10 etc.
Data TypeSize (byte)Min valueMax value
smallint2-32768+32767
integer4-2147483648+2147483647
bigint8-9223372036854775808+9223372036854775807

Numeric and Decimal

Numeric and Decimal are of variable size as the precision is user specified.
Data TypeSize (byte)Range
numericvariableup to 131072 digits before the decimal point; up to 16383 digits after the decimal point
decimalvariableup to 131072 digits before the decimal point; up to 16383 digits after the decimal point

Sunday, May 17, 2020

PostgreSQL - Getting Started

This is an introduction to PostgreSQL database.

What is PostgreSQL?

PostgreSQL is a RDBMS or Relational Database Management System. It is one of the popular and most advanced open source relational database and was developed at Berkeley Computer Science Department (University of California).

Versions of PostgreSQL

PostgreSQL can be installed on Windows, Mac and Linux personal computers and can also be installed on servers like Google Cloud, AWS (Amazon Web Services) etc.

Connecting to the database using psql

After installing the PostgreSQL database on your computer you can connect to it using psql command from your terminal.

Read more...