Errata

Practical PostgreSQL

Errata for Practical PostgreSQL

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
Printed Page xi

Could you let the authors know that following their instructions for
creating the test database - booktown failed comprehensively from this
machine, using PostgreSQL 7.2.1

Thus

-----
sql -U postgres template1 -f /Volumes/CDROM/booktown.sql
psql: warning: extra option -f ignored
psql: warning: extra option /Volumes/CDROM/booktown.sql ignored
Welcome to psql, the PostgreSQL interactive terminal.

Type: copyright for distribution terms
h for help with SQL commands
? for help on internal slash commands
g or terminate with semicolon to execute query
q to quit

template1=#

---

I eventually created the database by using the i command - but getting
the test database created is pretty fundamental to the use of the book,
so perhaps this could be reviewed.

Anonymous   
PDF Page acheter
rien

merci a tout

natalya  Jan 01, 2010 
Printed Page 6
Flexible API

More an omission, really. You can add Smalltalk to the list of languages with
interfaces to PostgreSQL.

Anonymous   
Printed Page 39
booktown installation instructions

A previous reader mentioned problems with loading the booktown.sql file. The correct
command to load should read:

psql -U postgres -f /mnt/cdrom/booktown.sql template1

The database always goes last on the psql command.

Anonymous   
Printed Page 76
Table 3-21

Pacific standard time is 8 hours behind GMT, not 7. Try

test=# select timestamp('2002-02-04 00:00:00 GMT') at time zone 'PST';
timezone
------------------------
2002-02-03 16:00:00-08
(1 row)

Anonymous   
Printed Page 77
6th paragraph

On the discussion of the AT TIME ZONE clause could specify that the argument can be column reference or (almost) any other valid SQ
L. PosstgreSQL seems to not implement the AT LOCAL syntax.

Example:

test=# select version();
version
-------------------------------------------------------------
PostgreSQL 7.1.3 on i686-pc-linux-gnu, compiled by GCC 2.96
(1 row)
test=# create table tz (t timestamp, z text);
CREATE
test=# insert into tz values (now(), 'GMT');
INSERT 340574 1
test=# insert into tz values (now(), 'PST');
INSERT 340575 1
test=# select t at time zone z from tz;
timezone
------------------------
2002-02-04 18:43:55+00
2002-02-04 10:44:00-08
(2 rows)

Note the unusual column name...

Anonymous   
Printed Page 77
5th paragraph

In the discussion of the SET TIMEZONE TO statement, and in particular in the example, you suggest that the argument could and shoul
d be a bareword (your example is SET TIMEZONE TO UTC). In fact, you should quote it, or the parser will convert it to lower case w
hich may (depending on your OS) not match an existing time zone.

[As an aside, the SQL standard seems to prefer the SET TIME ZONE <arg> syntax.]

Compare:

test=# set timezone to EST;
SET VARIABLE
test=# show timezone;
NOTICE: Time zone is est
SHOW VARIABLE
test=# select extract (year from timestamp with time zone '2000-01-01 00:00:00 GMT' );
date_part
-----------
2000
(1 row)
test=# set timezone to 'EST';
SET VARIABLE
test=# show timezone;
NOTICE: Time zone is EST
SHOW VARIABLE
test=# select extract (year from timestamp with time zone '2000-01-01 00:00:00 GMT' );
date_part
-----------
1999
(1 row)

Very confusing.......

test=# select version();
version
-------------------------------------------------------------
PostgreSQL 7.1.3 on i686-pc-linux-gnu, compiled by GCC 2.96
(1 row)

Anonymous   
Printed Page 79
Half way down page

The format for the INTERVAL command used in the book is incorrect.

In PostgreSQL 7.2.1 I get the following error:

proxylogs-# SELECT interval('21 years 8 days');
ERROR: parser: parse error at or near "'"

The correct form is:
proxylogs=# SELECT interval '21 years 8 days';
interval
-----------------
21 years 8 days
(1 row)

Anonymous   
Printed Page 105
Example 4-14

I believe I have found an small error in Example 4-14 of your book. I was viewing the online edition, so I cannot confirm that
the error also exists in the print edition, though I imagine it would.

I believe the final SQL statement in this example should read "DROP
old_books;", rather than "DROP books;"

The purpose of the example is to demonstrate how to use the CREATE TABLE
AS statement to select all but one column of data into a new table,
named "new_books". The existing (old) "books" table is then renamed to
"old_books", then the "new_books" table is renamed to "books". Finally
it is "old_books" that should (presumably) be dropped, not "books" as
per the example currently.

Anonymous   
Printed Page 260
Chapter "Inheritance"

I think the common consent is that inheritance in the current version of PostgreSQL is badly broken. It is an outstanding TODO ite
m.

You should at least mention (maybe with an owl) that all functions involving keys should be avoided. [It is probably better to avo
id inheritance completely....]

See for example http://archives.postgresql.org/pgsql-sql/2001-08/msg00047.php :

+++[Message 2]+++
* From: Allan Engelhardt <allane@cybaea.com>
* To: pgsql-sql@postgresql.org
* Subject: Inheritance is completely broken [was: Re: Creating foreign key constraint to child table?]
* Date: Sun, 05 Aug 2001 22:50:37 +0100

Dimitri pointed out (the post does not seem to have appered yet) that you can also do:

test=# create table foo(id integer primary key);
NOTICE: CREATE TABLE/PRIMARY KEY will create implicit index 'foo_pkey' for table 'foo'
CREATE
test=# create table bar () inherits (foo);
CREATE
test=# insert into foo values (1);
INSERT 12734236 1
test=# insert into foo values (1);
ERROR: Cannot insert a duplicate key into unique index foo_pkey
test=# insert into bar values (1);
INSERT 12734238 1
test=# select * from foo;
id
----
1
1
(2 rows)

So inheritance does seem to be completely broken. There is also an entry in the TODO list

Allow inherited tables to inherit index, UNIQUE constraint, and primary key, foreign key [inheritance]

which seems to be related. It doesn't have a dash, so I guess I won't hold my breath....

Anonymous   
Printed Page 440
Bottom paragraph

In this bit on advanced jdbc functionality, the author implies that CallableStatments
are implemented in the postgresql jdbc driver. In fact they are not, as of driver
version 7.2 (the most current release version as of 5/7/2002)! The best way to
execute pl/pgsql stored procedures from java is using the native postgres format of
"select function_name(argN...)". I would use a syntax like:

PreparedStatement ps = con.prepareStatment("select function_name(agrN...)");
ps.executeQuery();

Anonymous   
Printed Page 515
first definition of "function attributes"

The definition title is "iscachable", while in the text we refer to it as
"iscacheable".

Anonymous   
Printed Page 526
third paragraph

the function name "res_proc", named two times in the paragraph, should be in fixed
width italic, as it's defined in the operator definition

Anonymous   
Printed Page 527
end of paragraph defining "condition"

The text is "the condition may refer to the special new and old relations, which
represent the existing rows, and any new row data provided, respectively". As the
names say, this should be the opposite.

Anonymous   
Printed Page 533
First paragraph of "on update" item

"The ON DELETE clause indicates..." should read "The ON UPDATE clause
indicates ..."

Anonymous   
Printed Page 555
first item in "results"

The definition of "DROP" reads:
"The message returned when a user is dropped successfully"

As we're talking about DROP OPERATOR, it shoud read:
"The message returned when an operator is dropped successfully"

Anonymous   
Printed Page 594
"UNLISTEN" item

the "examples" title should read "parameters"

Anonymous   
Printed Page 614
2nd column

My copy of this book has no "E" entries in the index -- it just goes straight from
"D" to "F". Was this intentional?

Anonymous