Errata

PostgreSQL: Up and Running

Errata for PostgreSQL: Up and Running

Submit your own errata for this product.

The errata list is a list of errors and their corrections that were found after the product was released.

The following errata were submitted by our customers and have not yet been approved or disproved by the author or editor. They solely represent the opinion of the customer.

Color Key: Serious technical mistake Minor technical mistake Language or formatting error Typo Question Note Update

Version Location Description Submitted by Date submitted
Other Digital Version postgresql_book.sql
Error in running psql script

Kindle version of the book.

running the script in psql, I received:

ERROR: multiple primary keys for table "test_scores" are not allowed

The table was created with a PK, so it's just a minor error.

Anonymous  Nov 25, 2017 
Printed Page p61
Example 3-1

When I attempted this example using the PostgreSQL installed on my laptop, it did not work as expected -- the query results that are supposed to be sent to the file instead appeared on the screen, and when the last line of the example attempted to execute the output file, a file not found error was generated. When I changed the "\g" on the third line of the example to "\o" instead (as is used later in the example to turn off redirection the output), then it worked as I believe it is supposed to.

Anonymous  Jul 23, 2022 
Printed Page p68
Example 3-8

The query being passed to "gexec" seems to need a semi-colon at the end of it (before "\gexec") in order to work as shown.

Anonymous  Jul 23, 2022 
Printed, Other Digital Version Page 28
1st paragraph

The log_destination paragraph has the last sentence as:
Make sure you have logging_collection set to on if you want logging.

It should read as follows:
Make sure you have logging_collector set to on if you want logging.

The same applies to the Kindle version of the book.

Patrick Carlson  Nov 19, 2017 
Printed, PDF Page 33
6th paragrah

"Note the use of the modifier INHERIT. This means that any member of royalty will
automatically inherit privileges of the royalty role, except for the superuser privilege." - 2.3.2 Creating Group Roles, 2.3 Roles, 2 Database Administration [33]

For the privileges to be inherited "automatically", the keyword should have been used while creating the member roles 'leo' and 'regina'. Using the INHERIT modifier while creating a group role just allows it to pass on privileges that it inherits from other roles of which it is a member, to its own members. For a good example, see the PostgreSQL documentation for Role Membership at https://www.postgresql.org/docs/current/role-membership.html

Anonymous  Mar 24, 2021 
Printed Page 107
Points 1 to 4 in list

Dear authors, I believe there are mistakes in the time zone conversions.

The example should be corrected to:
1. Calculate the UTC time for 2012-02-14 18:08:00-8. This is 2012-02-15 02:08:00-0.
2. Store the value 2012-02-15 02:08:00.
...
1. ...
2. ...
3. Determine the datetime with the offset (2012-02-15 02:08:00 with a -5 offset becomes 2012-02-14 21:08:00).
4. Display the result (2012-02-14 21:08:00-5)

Best

Jerome Urbain   Mar 20, 2021 
Other Digital Version 131
Chapter 1, Why SQL, par. 6

On Kindle (location 131 of 8478) the statement is made: "Once you're versant in SQL".

The dictionary definition of versant is "a region of land sloping in one general direction."

Perhaps the author meant "conversant" or "versed".

Thank you for your work.

Kif Rivera  Apr 03, 2019 
Mobi Page 254 of 8463
database objects section -- extensions end of section

For example, PL/V8 must be installed >> in << the pg_catalog schema.

Missing the word 'in'


Regina O. Obe and Leo S. Hsu. PostgreSQL: Up and Running (Kindle Location 254). O'Reilly Media, Inc..


Send me an email if this is too fussy. It jumps out at me.

Chas

CHAS COLEMAN  Oct 03, 2018 
Mobi Page 676
footnote (3) for Example 2.2.Key Settings (on page 636) Error on pg 676

Error in text copied from book below...

setting is the current setting; boot_val is the default setting; reset_val is the new setting if you were to restart or reload the server. Make sure that setting and reset_val >>match<< after you make a change. If not, the server needs a restart or reload.


match is in italics, like the various ###_val settings, but it is not a setting, rather a description of what their values should be. match should be in regular font.

Regina O. Obe and Leo S. Hsu. PostgreSQL: Up and Running (Kindle Locations 682-684). O'Reilly Media, Inc..

Again, fussy I know but when dealing with exact terminology and operation of program you can't be too exact, right?

Chas

CHAS COLEMAN  Oct 03, 2018 
Mobi Page 1021
Upper third

Wait, it gets better. Because we named our roles to match their respective schemas, we’re blessed with another useful technique. But we must first introduce the search_path database variable.

Regina O. Obe and Leo S. Hsu. PostgreSQL: Up and Running (Kindle Locations 1021-1022). O'Reilly Media, Inc..

As a programmer who has operated both Linux and programs I understand that modifying a variable can have wider results than a value in memory.

In the case of the search_path ;variable (and I'm sure, others) this change is 'saved' by changing a value in a file and saving the file, making the change permanent.

This simple explanation was omitted, perhaps because it was well known to the author who assumed....

And there you go, how much should a beginner's text assume the one learning the program's operation knows how things work, at a deeper, functional level?

It's a hard decision process, too much detail and things bog down, the sophisticated user is turned off, too little and the neophyte is lost or never sees what is going on and finds out later, if at all

Case in point, examining the changed postgresql.conf file in the appropriate directory after issuing the 'search path = ######' command reveals what happens, and if you have the permissions you can edit or examine the file directly, an ability I think most Linux and database admins would aspire to as well as need to know as a method of resolving problems.

So take the leap and explain how PostgreSQL alters certain files when certain commands are issued, warn users about direct editing of the files, as you often do and move on. Makes the book more sophisticated and useful I think, and that's what you guys do so well.
Chas

CHAS COLEMAN  Oct 04, 2018 
Mobi Page 1132
Middle above section Title EXTENSIONS

After granting privileges to tables and functions with a schema, don’t forget to grant usage on the schema itself.

Regina O. Obe and Leo S. Hsu. PostgreSQL: Up and Running (Kindle Location 1132). O'Reilly Media, Inc..

WITH >> WITHIN

making this change the sentence reads:

After granting privileges to table and functions >>within<< a schema, don't forget to grant usage on the schema.

I think I'm right on this alteration of 'with' as these are objects that reside inside the logical/physical boundary formed when the schema is created then used, thus they would be 'within' the schema, not 'with' it.

Chas

You should have gone through Archaeology Grad School at TAMU with me, my professors were murderous with my term papers.

Also, if you don't' want minor errors like this raised, just tell me to shut up already :)
.

CHAS COLEMAN  Oct 04, 2018 
Mobi Page 1290
Second para under Title: Backup and Restore

Use pg_dump to back up specific databases. To back up all databases in plain text along with server globals, use pg_dumpall, which needs to run under a superuser account so that it back up all databases. Use pg_basebackup to do system-level disk backup of all databases.

Regina O. Obe and Leo S. Hsu. PostgreSQL: Up and Running (Kindle Locations 1286-1290). O'Reilly Media, Inc..

...which needs to be run under a superuser account so that it back up all databases...

BACK UP >> BACKS UP

...which needs to be run under a superuser account so it >>backs up<< all databases...

Chas

CHAS COLEMAN  Oct 04, 2018 
Other Digital Version 2315
example 5.7

Kindle version. Example 5.7 doesn't yield the result shown using version 9.6 and pgAdmin 4.2

SELECT regexp_replace( '6197306254', '([ 0-9]{ 3})([ 0-9]{ 3})([ 0-9]{ 4})', E'\(\\ 1\) \\ 2-\\ 3' ) As x;

Obe, Regina O.; Hsu, Leo S.. PostgreSQL: Up and Running: A Practical Guide to the Advanced Open Source Database (Kindle Locations 2316-2318). O'Reilly Media. Kindle Edition.

Anonymous  Nov 26, 2017 
Other Digital Version 2322
Example 5,8

Kindle version.

Query in example 5.8 yields no results.

Obe, Regina O.; Hsu, Leo S.. PostgreSQL: Up and Running: A Practical Guide to the Advanced Open Source Database (Kindle Locations 2324-2325). O'Reilly Media. Kindle Edition.

Anonymous  Nov 26, 2017 
Mobi Page 2323
second Paragrahp

Inclusion of a '+' symbol (quoted for clarity) in a syntax explanation when there is no + symbol in the code being explained, potentially confusing the reader who is then unsure if the example code is wrong or the explanation of it.

Pasting in the error text:

Example:

SELECT unnest( regexp_matches( 'Cell (619) 852-5083. Work (619) 123-4567 , Casa 619-730-6254. Bésame mucho.', E'[(]{ 0,1}[ 0-9]{ 3}[)-.]{ 0,1}[\\ s]{ 0,1}[ 0-9]{ 3}[-.]{ 0,1}[ 0-9]{ 4}', 'g') ) As x;

Regina O. Obe and Leo S. Hsu. PostgreSQL: Up and Running (Kindle Locations 2324-2327). O'Reilly Media, Inc..

Explanation:

The matching rules for Example   5-8 are:
[(]{ 0,1}: starts with zero or one open parenthesis.
[0-9]{ 3}: followed by three digits.
[)-.]{ 0,1}: followed by zero or one closed parenthesis, hyphen, or period.
>>>>> [\\ s] +: <<<<< followed by zero or more spaces.

S/B [\\s]: followed by zero or more spaces IMHO

Regina O. Obe and Leo S. Hsu. PostgreSQL: Up and Running (Kindle Locations 2328-2331). O'Reilly Media, Inc..

CHAS COLEMAN  Nov 02, 2018 
Other Digital Version 2431
Figure 5-11

Kindle version

Example 5-11 didn't work. This worked instead of the example given in 5-11; apparently Postgres wants the abbreviations for timezones.

SELECT '2012-02-28 10:00PM PST':: timestamptz AT TIME ZONE 'MET';

Anonymous  Nov 26, 2017