From 9515d57d05825d855f260dd44438584fbc3e2180 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Wed, 6 Nov 2002 23:30:39 +0000 Subject: [PATCH] Cleanup pass over Tutorial and Admin Guide --- doc/src/sgml/advanced.sgml | 46 ++-- doc/src/sgml/backup.sgml | 51 ++-- doc/src/sgml/client-auth.sgml | 29 +-- doc/src/sgml/diskusage.sgml | 11 +- doc/src/sgml/install-win32.sgml | 8 - doc/src/sgml/installation.sgml | 86 ++++--- doc/src/sgml/libpq.sgml | 17 +- doc/src/sgml/maintenance.sgml | 19 +- doc/src/sgml/manage-ag.sgml | 4 +- doc/src/sgml/monitoring.sgml | 374 ++++++++++++++------------- doc/src/sgml/query.sgml | 34 ++- doc/src/sgml/runtime.sgml | 430 +++++++++++++++++--------------- doc/src/sgml/start.sgml | 10 +- doc/src/sgml/user-manag.sgml | 8 +- 14 files changed, 587 insertions(+), 540 deletions(-) diff --git a/doc/src/sgml/advanced.sgml b/doc/src/sgml/advanced.sgml index 1a39a9b8ff..a31cf1076f 100644 --- a/doc/src/sgml/advanced.sgml +++ b/doc/src/sgml/advanced.sgml @@ -1,5 +1,5 @@ @@ -46,14 +46,14 @@ $Header: /cvsroot/pgsql/doc/src/sgml/advanced.sgml,v 1.30 2002/10/24 17:48:54 pe view over the query, which gives a name to the query that you can refer to like an ordinary table. - + CREATE VIEW myview AS SELECT city, temp_lo, temp_hi, prcp, date, location FROM weather, cities WHERE city = name; SELECT * FROM myview; - + @@ -101,7 +101,7 @@ SELECT * FROM myview; The new declaration of the tables would look like this: - + CREATE TABLE cities ( city varchar(80) primary key, location point @@ -114,23 +114,23 @@ CREATE TABLE weather ( prcp real, date date ); - + Now try inserting an invalid record: - + INSERT INTO weather VALUES ('Berkeley', 45, 53, 0.0, '1994-11-28'); - + - + ERROR: <unnamed> referential integrity violation - key referenced from weather not found in cities - + The behavior of foreign keys can be finely tuned to your application. We will not go beyond this simple example in this - tutorial, but just refer you to the &cite-reference; + tutorial, but just refer you to the &cite-user; for more information. Making correct use of foreign keys will definitely improve the quality of your database applications, so you are strongly encouraged to learn about them. @@ -161,7 +161,7 @@ ERROR: <unnamed> referential integrity violation - key referenced from we to Bob's account. Simplifying outrageously, the SQL commands for this might look like - + UPDATE accounts SET balance = balance - 100.00 WHERE name = 'Alice'; UPDATE branches SET balance = balance - 100.00 @@ -170,7 +170,7 @@ UPDATE accounts SET balance = balance + 100.00 WHERE name = 'Bob'; UPDATE branches SET balance = balance + 100.00 WHERE name = (SELECT branch_name FROM accounts WHERE name = 'Bob'); - + @@ -222,13 +222,13 @@ UPDATE branches SET balance = balance + 100.00 BEGIN and COMMIT commands. So our banking transaction would actually look like - + BEGIN; UPDATE accounts SET balance = balance - 100.00 WHERE name = 'Alice'; -- etc etc COMMIT; - + @@ -278,7 +278,7 @@ COMMIT; implicitly when you list all cities. If you're really clever you might invent some scheme like this: - + CREATE TABLE capitals ( name text, population real, @@ -296,7 +296,7 @@ CREATE VIEW cities AS SELECT name, population, altitude FROM capitals UNION SELECT name, population, altitude FROM non_capitals; - + This works OK as far as querying goes, but it gets ugly when you need to update several rows, to name one thing. @@ -305,7 +305,7 @@ CREATE VIEW cities AS A better solution is this: - + CREATE TABLE cities ( name text, population real, @@ -315,7 +315,7 @@ CREATE TABLE cities ( CREATE TABLE capitals ( state char(2) ) INHERITS (cities); - + @@ -336,11 +336,11 @@ CREATE TABLE capitals ( including state capitals, that are located at an altitude over 500 ft.: - + SELECT name, altitude FROM cities WHERE altitude > 500; - + which returns: @@ -359,11 +359,11 @@ SELECT name, altitude all the cities that are not state capitals and are situated at an altitude of 500 ft. or higher: - + SELECT name, altitude FROM ONLY cities WHERE altitude > 500; - + name | altitude @@ -380,7 +380,7 @@ SELECT name, altitude cities table, and not tables below cities in the inheritance hierarchy. Many of the commands that we have already discussed -- - SELECT, UPDATE and + SELECT, UPDATE, and DELETE -- support this ONLY notation. diff --git a/doc/src/sgml/backup.sgml b/doc/src/sgml/backup.sgml index 8c3e8246aa..488721757c 100644 --- a/doc/src/sgml/backup.sgml +++ b/doc/src/sgml/backup.sgml @@ -1,5 +1,5 @@ Backup and Restore @@ -64,7 +64,7 @@ pg_dump dbname > As any other PostgreSQL client application, pg_dump will by default connect with the database - user name that is equal to the current Unix user name. To override + user name that is equal to the current operating system user name. To override this, either specify the option or set the environment variable PGUSER. Remember that pg_dump connections are subject to the normal @@ -104,9 +104,9 @@ psql dbname < where infile is what you used as outfile - for the pg_dump command. The database pg_dump command. The database dbname will not be created by this - command, you must create it yourself from template0 before executing + command, you must create it yourself from template0 before executing psql (e.g., with createdb -T template0 dbname). psql supports similar options to pg_dump @@ -129,23 +129,22 @@ psql dbname < pg_dump and psql to write to or read from pipes makes it possible to dump a database directly from one server to another, for example - pg_dump -h host1 dbname | psql -h host2 dbname - - - - - The dumps produced by pg_dump are relative to template0. This means - that any languages, procedures, etc. added to template1 will also be - dumped by pg_dump. As a result, when restoring, if - you are using a customized template1, you must create the empty - database from template0, as in the example above. - - + + + The dumps produced by pg_dump are relative to + template0. This means that any languages, procedures, + etc. added to template1 will also be dumped by + pg_dump. As a result, when restoring, if you are + using a customized template1, you must create the + empty database from template0, as in the example + above. + + @@ -222,20 +221,16 @@ cat filename.gz | gunzip | psql pg_dump dbname | split -b 1m - filename - Reload with - createdb dbname cat filename* | psql dbname - @@ -249,14 +244,11 @@ cat filename* | psql pg_dump -Fc dbname > filename - See the pg_dump and pg_restore reference pages for details. - @@ -284,7 +276,7 @@ pg_dump -Fc dbname > For reasons of backward compatibility, pg_dump does not dump large objects by default. To dump large objects you must use - either the custom or the TAR output format, and use the -b option in + either the custom or the TAR output format, and use the