Database Reference
In-Depth Information
• Trigger and procedure support with multiple procedural languages
• Extensibility in the sense of adding new data types and the client language
From the early releases of PostgreSQL (from version 6.0 that is), many changes have
been made, with each new major version adding new and more advanced features.
The current version is PostgreSQL 9.4 and is available from several sources and in
various binary formats.
We will be using PostgreSQL 9.4 throughout this topic. So, let's
download and install it so that we can start our remarkable journey in
this topic.
In this chapter, you will learn about the following topics:
• Writing queries using psql
• Creating, altering, and truncating a table
• Inserting, updating, and deleting data
• PostgreSQL-supported data types
• PostgreSQL-supported operators and usage
• Constraints and privileges in PostgreSQL
Writing queries using psql
Before proceeding, allow me to explain to you that throughout this topic, we will use
a warehouse database called warehouse_db . In this section, I will show you how you
can create such a database, providing you with sample code for assistance. You will
need to do the following:
1.
We are assuming here that you have successfully installed PostgreSQL and
faced no issues. Now, you will need to connect with the default database that
is created by the PostgreSQL installer. To do this, navigate to the default path
of installation, which is /opt/PostgreSQL/9.4/bin from your command
line, and execute the following command that will prompt for a postgres
user password that you provided during the installation:
/opt/PostgreSQL/9.4/bin$./psql -U postgres
Password for user postgres:
 
Search WWH ::




Custom Search