To get the most out of this book
For this book to be useful, basic knowledge of the Linux (or another Unix-like) operating system is required. All the SQL examples can be run using the psql
command-line program or any available GUI tool (not presented in the book), like the PostgreSQL-specific pgAdmin4. Shell scripts will be executed using the GNU Bash scripting language.
Software/hardware covered in the book |
OS requirements |
PostgreSQL 16 |
Linux OS/Unix-like OS (e.g., FreeBSD, OpenBSD) |
The book provides a set of Docker images, so that the reader can follow and test all the code examples. Running the Docker images is not mandatory, but it does not require you to have your own customized PostgreSQL installation. In order to run the Docker images, you need to install the Docker application on your operating system.
If you are using the digital version of this book, we advise you to type the code yourself or access the code via the GitHub repository (link available in the next section). Doing so will help you avoid any potential errors related to the copying and pasting of code.
Download the example code files
The code bundle for the book is hosted on GitHub at https://github.com/PacktPublishing/Learn-PostgreSQL-Second-Edition. We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!
Download the color images
We also provide a PDF file that has color images of the screenshots/diagrams used in this book. You can download it here: https://packt.link/gbp/9781837635641.
Conventions used
There are a number of text conventions used throughout this book.
CodeInText
: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. For example: “Mount the downloaded WebStorm-10*.dmg
disk image file as another disk in your system.”
A block of code is set as follows:
SELECT rolname, rolcanlogin,
rolconnlimit, rolpassword
FROM pg_roles
WHERE rolname = 'luca';
When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:
SELECT line_number, type,
database, user_name,
address, auth_method
FROM pg_hba_file_rules;
Any command-line input or output is written as follows:
$ sudo cat $PGDATA/rejected_users.txt
Bold: Indicates a new term, an important word, or words that you see on the screen. For instance, words in menus or dialog boxes appear in the text like this. For example: “Select System info from the Administration panel.”
Warnings or important notes appear like this.
Tips and tricks appear like this.