Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying PostgreSQL for Data Architects
  • Table Of Contents Toc
PostgreSQL for Data Architects

PostgreSQL for Data Architects

By : Jayadevan M
5 (2)
close
close
PostgreSQL for Data Architects

PostgreSQL for Data Architects

5 (2)
By: Jayadevan M

Overview of this book

This book is for developers and data architects who have some exposure to databases. It is assumed that you understand the basic concepts of tables and common database objects, including privileges and security.
Table of Contents (14 chapters)
close
close
13
Index

Installing and moving the files to where they belong

This is the step where the files are copied to the correct directories. As the installation process involves writing files to directories, which an ordinary user cannot write to, we need to use su for this step:

su

If you are interested in seeing what happens during the installation step, redirect the output to a file, for example, gmake install-world > /tmp/install.out.

We used the keyword world for make. We will use a similar option for installation too:

gmake install-world

If all goes well, we will see a message that says PostgreSQL, contrib, and documentation successfully made. Ready to install. If the output was directed to a file as mentioned, we can open it and see that the installation process created a /usr/local/pgsql directory with a few subdirectories for various components. Then, the install command copied the directories and files to target directories and set attributes such as permissions. Refer to the highlighted portion in the following screenshot:

Installing and moving the files to where they belong

Inspecting the changes

As we did not make any changes to the default options, the installation files will be at /usr/local/pgsql. In this, we have four directories, namely include, lib, share, and bin. The include directory contains header files (.h) extension, and the lib directory contains all the libraries to be linked dynamically (.so in the case of Linux/Unix systems and .dll in the case of Windows systems). The bin directory, of course, contains executables.

It is the share directory that is a bit more interesting. Here, we have a number of sample files, namely, pg_hba.conf.sample, pg_ident.conf.sample, pg_service.conf.sample, postgresql.conf.sample, psqlrc.sample, and recovery.conf.sample. Once we initialize a cluster and make changes to various configuration files and then lose track of the changes, we can compare with these files and understand what changes have been made or roll back the changes if necessary.

This directory also has a few SQL files such as information_schema.sql and system_view.sql, which go into creating metadata views when a database cluster is initialized.

At the next level of directories under share, we have the doc directory that holds the documentation, and the man directory that holds the manual pages, and so on. The directory of interest under share is the one named extension. Here, we can see all the extensions, which we can install as per our need. Most extensions have a .control file that provides basic information, as shown here:

[jay@MyCentOS extension]$ more dblink.control
# dblink extension
comment = 'connect to other PostgreSQL databases from within a database'
default_version = '1.1'
module_pathname = '$libdir/dblink'
relocatable = true

There will be SQL files that correspond to each extension, and these will be used when we install the extension in a database we choose.

The documentation to install PostgreSQL from source is at http://www.postgresql.org/docs/current/static/installation.html.

Note that we have just installed the database software. There is no database available to connect to yet. Adding a user for the database administration tasks and initializing a database cluster are the next steps.

CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
PostgreSQL for Data Architects
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon