From 1ced129aa33af76d9cc39319265741e4d170d0fb Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Sat, 22 Jan 2005 22:56:36 +0000 Subject: [PATCH] More < and > cleanups converted to ampersands. --- doc/src/sgml/backup.sgml | 8 ++++---- doc/src/sgml/datatype.sgml | 6 +++--- doc/src/sgml/ddl.sgml | 30 +++++++++++++-------------- doc/src/sgml/dfunc.sgml | 4 ++-- doc/src/sgml/dml.sgml | 4 ++-- doc/src/sgml/ecpg.sgml | 4 ++-- doc/src/sgml/func.sgml | 4 ++-- doc/src/sgml/geqo.sgml | 4 ++-- doc/src/sgml/indices.sgml | 8 ++++---- doc/src/sgml/plpgsql.sgml | 20 +++++++++--------- doc/src/sgml/pltcl.sgml | 10 ++++----- doc/src/sgml/queries.sgml | 42 +++++++++++++++++++------------------- doc/src/sgml/query.sgml | 12 +++++------ doc/src/sgml/release.sgml | 22 ++++++++++---------- doc/src/sgml/rowtypes.sgml | 10 ++++----- doc/src/sgml/rules.sgml | 30 +++++++++++++-------------- doc/src/sgml/runtime.sgml | 6 +++--- doc/src/sgml/spi.sgml | 32 ++++++++++++++--------------- doc/src/sgml/sql.sgml | 22 ++++++++++---------- doc/src/sgml/trigger.sgml | 28 ++++++++++++------------- doc/src/sgml/xaggr.sgml | 6 +++--- doc/src/sgml/xfunc.sgml | 4 ++-- 22 files changed, 158 insertions(+), 158 deletions(-) diff --git a/doc/src/sgml/backup.sgml b/doc/src/sgml/backup.sgml index 76457b6842..b2309262e4 100644 --- a/doc/src/sgml/backup.sgml +++ b/doc/src/sgml/backup.sgml @@ -1,5 +1,5 @@ Backup and Restore @@ -256,7 +256,7 @@ cat filename* | psql -pg_dump -Fc dbname > filename +pg_dump -Fc dbname > filename A custom-format dump is not a script for psql, but @@ -1203,14 +1203,14 @@ pg_dumpall -p 5432 | psql -d template1 -p 6543 version, start the new server, restore the data. For example: -pg_dumpall > backup +pg_dumpall > backup pg_ctl stop mv /usr/local/pgsql /usr/local/pgsql.old cd ~/postgresql-&version; gmake install initdb -D /usr/local/pgsql/data postmaster -D /usr/local/pgsql/data -psql template1 < backup +psql template1 < backup See about ways to start and stop the diff --git a/doc/src/sgml/datatype.sgml b/doc/src/sgml/datatype.sgml index 0ca87bfb2c..3794aa2f78 100644 --- a/doc/src/sgml/datatype.sgml +++ b/doc/src/sgml/datatype.sgml @@ -1,5 +1,5 @@ @@ -1645,7 +1645,7 @@ SELECT b, char_length(b) FROM test2; 04:05 PM - same as 16:05; input hour must be <= 12 + same as 16:05; input hour must be <= 12 04:05:06.789-8 @@ -2367,7 +2367,7 @@ SELECT * FROM test1 WHERE a; circle 24 bytes Circle - <(x,y),r> (center and radius) + <(x,y),r> (center and radius) diff --git a/doc/src/sgml/ddl.sgml b/doc/src/sgml/ddl.sgml index 727b00f0ea..2de8888254 100644 --- a/doc/src/sgml/ddl.sgml +++ b/doc/src/sgml/ddl.sgml @@ -1,4 +1,4 @@ - + Data Definition @@ -275,7 +275,7 @@ CREATE TABLE products ( CREATE TABLE products ( product_no integer, name text, - price numeric CHECK (price > 0) + price numeric CHECK (price > 0) ); @@ -303,7 +303,7 @@ CREATE TABLE products ( CREATE TABLE products ( product_no integer, name text, - price numeric CONSTRAINT positive_price CHECK (price > 0) + price numeric CONSTRAINT positive_price CHECK (price > 0) ); So, to specify a named constraint, use the key word @@ -320,9 +320,9 @@ CREATE TABLE products ( CREATE TABLE products ( product_no integer, name text, - price numeric CHECK (price > 0), - discounted_price numeric CHECK (discounted_price > 0), - CHECK (price > discounted_price) + price numeric CHECK (price > 0), + discounted_price numeric CHECK (discounted_price > 0), + CHECK (price > discounted_price) ); @@ -350,10 +350,10 @@ CREATE TABLE products ( product_no integer, name text, price numeric, - CHECK (price > 0), + CHECK (price > 0), discounted_price numeric, - CHECK (discounted_price > 0), - CHECK (price > discounted_price) + CHECK (discounted_price > 0), + CHECK (price > discounted_price) ); or even @@ -361,9 +361,9 @@ CREATE TABLE products ( CREATE TABLE products ( product_no integer, name text, - price numeric CHECK (price > 0), + price numeric CHECK (price > 0), discounted_price numeric, - CHECK (discounted_price > 0 AND price > discounted_price) + CHECK (discounted_price > 0 AND price > discounted_price) ); It's a matter of taste. @@ -377,10 +377,10 @@ CREATE TABLE products ( product_no integer, name text, price numeric, - CHECK (price > 0), + CHECK (price > 0), discounted_price numeric, - CHECK (discounted_price > 0), - CONSTRAINT valid_discount CHECK (price > discounted_price) + CHECK (discounted_price > 0), + CONSTRAINT valid_discount CHECK (price > discounted_price) ); @@ -442,7 +442,7 @@ CREATE TABLE products ( CREATE TABLE products ( product_no integer NOT NULL, name text NOT NULL, - price numeric NOT NULL CHECK (price > 0) + price numeric NOT NULL CHECK (price > 0) ); The order doesn't matter. It does not necessarily determine in which diff --git a/doc/src/sgml/dfunc.sgml b/doc/src/sgml/dfunc.sgml index 406112a3b8..2c1a2771e5 100644 --- a/doc/src/sgml/dfunc.sgml +++ b/doc/src/sgml/dfunc.sgml @@ -1,5 +1,5 @@ @@ -307,7 +307,7 @@ cc -c foo.c You must then create a symbol \*(lqexports\*(rq file for the object file: .nf -mkldexport foo.o `pwd` > foo.exp +mkldexport foo.o `pwd` > foo.exp .fi Finally, you can create the shared library: .nf diff --git a/doc/src/sgml/dml.sgml b/doc/src/sgml/dml.sgml index 53eeea49aa..91e7e137f1 100644 --- a/doc/src/sgml/dml.sgml +++ b/doc/src/sgml/dml.sgml @@ -1,4 +1,4 @@ - + Data Manipulation @@ -191,7 +191,7 @@ UPDATE products SET price = price * 1.10; UPDATE command by listing more than one assignment in the SET clause. For example: -UPDATE mytable SET a = 5, b = 3, c = 1 WHERE a > 0; +UPDATE mytable SET a = 5, b = 3, c = 1 WHERE a > 0; diff --git a/doc/src/sgml/ecpg.sgml b/doc/src/sgml/ecpg.sgml index 173c4f9c73..965cd75d3a 100644 --- a/doc/src/sgml/ecpg.sgml +++ b/doc/src/sgml/ecpg.sgml @@ -1,5 +1,5 @@ @@ -627,7 +627,7 @@ EXEC SQL EXECUTE mystmt USING 42, 'foobar'; INTO clause: EXEC SQL BEGIN DECLARE SECTION; -const char *stmt = "SELECT a, b, c FROM test1 WHERE a > ?"; +const char *stmt = "SELECT a, b, c FROM test1 WHERE a > ?"; int v1, v2; VARCHAR v3; EXEC SQL END DECLARE SECTION; diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml index c01fad599a..2917cf1a44 100644 --- a/doc/src/sgml/func.sgml +++ b/doc/src/sgml/func.sgml @@ -1,5 +1,5 @@ @@ -5890,7 +5890,7 @@ SELECT TIMESTAMP 'now'; >^ Is above? - circle '((0,5),1)' >^ circle '((0,0),1)' + circle '((0,5),1)' >^ circle '((0,0),1)' ?# diff --git a/doc/src/sgml/geqo.sgml b/doc/src/sgml/geqo.sgml index 5822199860..cb7d2f38d1 100644 --- a/doc/src/sgml/geqo.sgml +++ b/doc/src/sgml/geqo.sgml @@ -1,5 +1,5 @@ @@ -147,7 +147,7 @@ Genetic Optimizer +=========================================+ -|>>>>>>>>>>> Algorithm GA <<<<<<<<<<<<<<| +|>>>>>>>>>>> Algorithm GA <<<<<<<<<<<<<<| +=========================================+ | INITIALIZE t := 0 | +=========================================+ diff --git a/doc/src/sgml/indices.sgml b/doc/src/sgml/indices.sgml index 85cabecf05..41f87d60f6 100644 --- a/doc/src/sgml/indices.sgml +++ b/doc/src/sgml/indices.sgml @@ -1,4 +1,4 @@ - + Indexes @@ -563,7 +563,7 @@ CREATE TABLE access_log ( such as this: CREATE INDEX access_log_client_ip_ix ON access_log (client_ip) - WHERE NOT (client_ip > inet '192.168.100.0' AND client_ip < inet '192.168.100.255'); + WHERE NOT (client_ip > inet '192.168.100.0' AND client_ip < inet '192.168.100.255'); @@ -617,12 +617,12 @@ CREATE INDEX orders_unbilled_index ON orders (order_nr) A possible query to use this index would be -SELECT * FROM orders WHERE billed is not true AND order_nr < 10000; +SELECT * FROM orders WHERE billed is not true AND order_nr < 10000; However, the index can also be used in queries that do not involve order_nr at all, e.g., -SELECT * FROM orders WHERE billed is not true AND amount > 5000.00; +SELECT * FROM orders WHERE billed is not true AND amount > 5000.00; This is not as efficient as a partial index on the amount column would be, since the system has to diff --git a/doc/src/sgml/plpgsql.sgml b/doc/src/sgml/plpgsql.sgml index 3a283bce5e..64a0af6cff 100644 --- a/doc/src/sgml/plpgsql.sgml +++ b/doc/src/sgml/plpgsql.sgml @@ -1,5 +1,5 @@ @@ -1570,7 +1570,7 @@ END IF; -IF v_count > 0 THEN +IF v_count > 0 THEN INSERT INTO users_count (count) VALUES (v_count); RETURN 't'; ELSE @@ -3233,7 +3233,7 @@ BEGIN SELECT count(*) INTO a_running_job_count FROM cs_jobs WHERE end_stamp IS NULL; - IF a_running_job_count > 0 THEN + IF a_running_job_count > 0 THEN COMMIT; -- free lock raise_application_error(-20000, 'Unable to create a new job: a job is currently running.'); END IF; @@ -3299,7 +3299,7 @@ BEGIN SELECT count(*) INTO a_running_job_count FROM cs_jobs WHERE end_stamp IS NULL; - IF a_running_job_count > 0 THEN + IF a_running_job_count > 0 THEN RAISE EXCEPTION 'Unable to create a new job: a job is currently running'; END IF; @@ -3464,7 +3464,7 @@ DECLARE length integer; ss_length integer; BEGIN - IF beg_index > 0 THEN + IF beg_index > 0 THEN temp_str := substring(string FROM beg_index); pos := position(string_to_search IN temp_str); @@ -3478,11 +3478,11 @@ BEGIN length := char_length(string); beg := length + beg_index - ss_length + 2; - WHILE beg > 0 LOOP + WHILE beg > 0 LOOP temp_str := substring(string FROM beg FOR ss_length); pos := position(string_to_search IN temp_str); - IF pos > 0 THEN + IF pos > 0 THEN RETURN beg; END IF; @@ -3507,7 +3507,7 @@ DECLARE length integer; ss_length integer; BEGIN - IF beg_index > 0 THEN + IF beg_index > 0 THEN beg := beg_index; temp_str := substring(string FROM beg_index); @@ -3533,11 +3533,11 @@ BEGIN length := char_length(string); beg := length + beg_index - ss_length + 2; - WHILE beg > 0 LOOP + WHILE beg > 0 LOOP temp_str := substring(string FROM beg FOR ss_length); pos := position(string_to_search IN temp_str); - IF pos > 0 THEN + IF pos > 0 THEN occur_number := occur_number + 1; IF occur_number = occur_index THEN diff --git a/doc/src/sgml/pltcl.sgml b/doc/src/sgml/pltcl.sgml index 0ba4d22859..1d22035fa9 100644 --- a/doc/src/sgml/pltcl.sgml +++ b/doc/src/sgml/pltcl.sgml @@ -1,5 +1,5 @@ @@ -102,7 +102,7 @@ $$ LANGUAGE pltcl; CREATE FUNCTION tcl_max(integer, integer) RETURNS integer AS $$ - if {$1 > $2} {return $1} + if {$1 > $2} {return $1} return $2 $$ LANGUAGE pltcl STRICT; @@ -129,7 +129,7 @@ CREATE FUNCTION tcl_max(integer, integer) RETURNS integer AS $$ return $2 } if {[argisnull 2]} { return $1 } - if {$1 > $2} {return $1} + if {$1 > $2} {return $1} return $2 $$ LANGUAGE pltcl; @@ -156,10 +156,10 @@ CREATE TABLE employee ( ); CREATE FUNCTION overpaid(employee) RETURNS boolean AS $$ - if {200000.0 < $1(salary)} { + if {200000.0 < $1(salary)} { return "t" } - if {$1(age) < 30 && 100000.0 < $1(salary)} { + if {$1(age) < 30 && 100000.0 < $1(salary)} { return "t" } return "f" diff --git a/doc/src/sgml/queries.sgml b/doc/src/sgml/queries.sgml index d2011f4457..93323463fa 100644 --- a/doc/src/sgml/queries.sgml +++ b/doc/src/sgml/queries.sgml @@ -1,4 +1,4 @@ - + Queries @@ -374,7 +374,7 @@ FROM table_reference , table_r then we get the following results for the various joins: -=> SELECT * FROM t1 CROSS JOIN t2; +=> SELECT * FROM t1 CROSS JOIN t2; num | name | num | value -----+------+-----+------- 1 | a | 1 | xxx @@ -388,28 +388,28 @@ FROM table_reference , table_r 3 | c | 5 | zzz (9 rows) -=> SELECT * FROM t1 INNER JOIN t2 ON t1.num = t2.num; +=> SELECT * FROM t1 INNER JOIN t2 ON t1.num = t2.num; num | name | num | value -----+------+-----+------- 1 | a | 1 | xxx 3 | c | 3 | yyy (2 rows) -=> SELECT * FROM t1 INNER JOIN t2 USING (num); +=> SELECT * FROM t1 INNER JOIN t2 USING (num); num | name | value -----+------+------- 1 | a | xxx 3 | c | yyy (2 rows) -=> SELECT * FROM t1 NATURAL INNER JOIN t2; +=> SELECT * FROM t1 NATURAL INNER JOIN t2; num | name | value -----+------+------- 1 | a | xxx 3 | c | yyy (2 rows) -=> SELECT * FROM t1 LEFT JOIN t2 ON t1.num = t2.num; +=> SELECT * FROM t1 LEFT JOIN t2 ON t1.num = t2.num; num | name | num | value -----+------+-----+------- 1 | a | 1 | xxx @@ -417,7 +417,7 @@ FROM table_reference , table_r 3 | c | 3 | yyy (3 rows) -=> SELECT * FROM t1 LEFT JOIN t2 USING (num); +=> SELECT * FROM t1 LEFT JOIN t2 USING (num); num | name | value -----+------+------- 1 | a | xxx @@ -425,7 +425,7 @@ FROM table_reference , table_r 3 | c | yyy (3 rows) -=> SELECT * FROM t1 RIGHT JOIN t2 ON t1.num = t2.num; +=> SELECT * FROM t1 RIGHT JOIN t2 ON t1.num = t2.num; num | name | num | value -----+------+-----+------- 1 | a | 1 | xxx @@ -433,7 +433,7 @@ FROM table_reference , table_r | | 5 | zzz (3 rows) -=> SELECT * FROM t1 FULL JOIN t2 ON t1.num = t2.num; +=> SELECT * FROM t1 FULL JOIN t2 ON t1.num = t2.num; num | name | num | value -----+------+-----+------- 1 | a | 1 | xxx @@ -450,7 +450,7 @@ FROM table_reference , table_r prove useful for some queries but needs to be thought out carefully. For example: -=> SELECT * FROM t1 LEFT JOIN t2 ON t1.num = t2.num AND t2.value = 'xxx'; +=> SELECT * FROM t1 LEFT JOIN t2 ON t1.num = t2.num AND t2.value = 'xxx'; num | name | num | value -----+------+-----+------- 1 | a | 1 | xxx @@ -508,7 +508,7 @@ SELECT * FROM some_very_long_table_name s JOIN another_fairly_long_name a ON s.i current query — it is no longer possible to refer to the table by the original name. Thus -SELECT * FROM my_table AS m WHERE my_table.a > 5; +SELECT * FROM my_table AS m WHERE my_table.a > 5; is not valid SQL syntax. What will actually happen (this is a PostgreSQL extension to the standard) @@ -516,7 +516,7 @@ SELECT * FROM my_table AS m WHERE my_table.a > 5; FROM clause, so the query is processed as if it were written as -SELECT * FROM my_table AS m, my_table AS my_table WHERE my_table.a > 5; +SELECT * FROM my_table AS m, my_table AS my_table WHERE my_table.a > 5; which will result in a cross join, which is usually not what you want. @@ -732,7 +732,7 @@ FROM a NATURAL JOIN b WHERE b.val > 5 Here are some examples of WHERE clauses: -SELECT ... FROM fdt WHERE c1 > 5 +SELECT ... FROM fdt WHERE c1 > 5 SELECT ... FROM fdt WHERE c1 IN (1, 2, 3) @@ -742,7 +742,7 @@ SELECT ... FROM fdt WHERE c1 IN (SELECT c3 FROM t2 WHERE c2 = fdt.c1 + 10) SELECT ... FROM fdt WHERE c1 BETWEEN (SELECT c3 FROM t2 WHERE c2 = fdt.c1 + 10) AND 100 -SELECT ... FROM fdt WHERE EXISTS (SELECT c1 FROM t2 WHERE c2 > fdt.c1) +SELECT ... FROM fdt WHERE EXISTS (SELECT c1 FROM t2 WHERE c2 > fdt.c1) fdt is the table derived in the FROM clause. Rows that do not meet the search @@ -795,7 +795,7 @@ SELECT select_list eliminate redundancy in the output and/or compute aggregates that apply to these groups. For instance: -=> SELECT * FROM test1; +=> SELECT * FROM test1; x | y ---+--- a | 3 @@ -804,7 +804,7 @@ SELECT select_list a | 1 (4 rows) -=> SELECT x FROM test1 GROUP BY x; +=> SELECT x FROM test1 GROUP BY x; x --- a @@ -827,7 +827,7 @@ SELECT select_list used in the grouping cannot be referenced except in aggregate expressions. An example with aggregate expressions is: -=> SELECT x, sum(y) FROM test1 GROUP BY x; +=> SELECT x, sum(y) FROM test1 GROUP BY x; x | sum ---+----- a | 4 @@ -901,14 +901,14 @@ SELECT select_list FROM ... WHERE ... Example: -=> SELECT x, sum(y) FROM test1 GROUP BY x HAVING sum(y) > 3; +=> SELECT x, sum(y) FROM test1 GROUP BY x HAVING sum(y) > 3; x | sum ---+----- a | 4 b | 5 (2 rows) -=> SELECT x, sum(y) FROM test1 GROUP BY x HAVING x < 'c'; +=> SELECT x, sum(y) FROM test1 GROUP BY x HAVING x < 'c'; x | sum ---+----- a | 4 @@ -922,9 +922,9 @@ SELECT select_list FROM ... WHERE ... SELECT product_id, p.name, (sum(s.units) * (p.price - p.cost)) AS profit FROM products p LEFT JOIN sales s USING (product_id) - WHERE s.date > CURRENT_DATE - INTERVAL '4 weeks' + WHERE s.date > CURRENT_DATE - INTERVAL '4 weeks' GROUP BY product_id, p.name, p.price, p.cost - HAVING sum(p.price * s.units) > 5000; + HAVING sum(p.price * s.units) > 5000; In the example above, the WHERE clause is selecting rows by a column that is not grouped (the expression is only true for diff --git a/doc/src/sgml/query.sgml b/doc/src/sgml/query.sgml index 7478b4251f..366820e554 100644 --- a/doc/src/sgml/query.sgml +++ b/doc/src/sgml/query.sgml @@ -1,5 +1,5 @@ @@ -605,8 +605,8 @@ SELECT * SELECT W1.city, W1.temp_lo AS low, W1.temp_hi AS high, W2.city, W2.temp_lo AS low, W2.temp_hi AS high FROM weather W1, weather W2 - WHERE W1.temp_lo < W2.temp_lo - AND W1.temp_hi > W2.temp_hi; + WHERE W1.temp_lo < W2.temp_lo + AND W1.temp_hi > W2.temp_hi; city | low | high | city | low | high ---------------+-----+------+---------------+-----+------ @@ -737,7 +737,7 @@ SELECT city, max(temp_lo) SELECT city, max(temp_lo) FROM weather GROUP BY city - HAVING max(temp_lo) < 40; + HAVING max(temp_lo) < 40; @@ -757,7 +757,7 @@ SELECT city, max(temp_lo) FROM weather WHERE city LIKE 'S%' GROUP BY city - HAVING max(temp_lo) < 40; + HAVING max(temp_lo) < 40; @@ -814,7 +814,7 @@ SELECT city, max(temp_lo) UPDATE weather SET temp_hi = temp_hi - 2, temp_lo = temp_lo - 2 - WHERE date > '1994-11-28'; + WHERE date > '1994-11-28'; diff --git a/doc/src/sgml/release.sgml b/doc/src/sgml/release.sgml index 847a4d3941..96f260c5a4 100644 --- a/doc/src/sgml/release.sgml +++ b/doc/src/sgml/release.sgml @@ -1,5 +1,5 @@ @@ -945,7 +945,7 @@ $PostgreSQL: pgsql/doc/src/sgml/release.sgml,v 1.322 2005/01/22 22:06:17 momjian Fixes improper failure of cases such as SELECT SUM(win)/SUM(lose) - ... GROUP BY ... HAVING SUM(lose) > 0. This should work but formerly + ... GROUP BY ... HAVING SUM(lose) > 0. This should work but formerly could fail with divide-by-zero. @@ -2776,7 +2776,7 @@ DROP SCHEMA information_schema CASCADE; Force zero_damaged_pages to be on during recovery from WAL Prevent some obscure cases of variable not in subplan target lists Make PQescapeBytea and byteaout consistent with each other (Joe) -Escape bytea output for bytes > 0x7e(Joe) +Escape bytea output for bytes > 0x7e(Joe) If different client encodings are used for bytea output and input, it is possible for bytea values to be corrupted by the differing @@ -4609,7 +4609,7 @@ DROP SCHEMA information_schema CASCADE; Allow libpq to compile with Borland C++ compiler (Lester Godwin, Karl Waclawek) Use our own version of getopt_long() if needed (Peter) Convert administration scripts to C (Peter) - Bison >= 1.85 is now required to build the PostgreSQL grammar, if building from CVS + Bison >= 1.85 is now required to build the PostgreSQL grammar, if building from CVS Merge documentation into one book (Peter) Add Windows compatibility functions (Bruce) Allow client interfaces to compile under MinGW (Bruce) @@ -5450,7 +5450,7 @@ operations on bytea columns (Joe) Make cursors insensitive, meaning their contents do not change (Tom) Disable LIMIT #,# syntax; now only LIMIT # OFFSET # supported (Bruce) Increase identifier length to 63 (Neil, Bruce) -UNION fixes for merging >= 3 columns of different lengths (Tom) +UNION fixes for merging >= 3 columns of different lengths (Tom) Add DEFAULT key word to INSERT, e.g., INSERT ... (..., DEFAULT, ...) (Rod) Allow views to have default values using ALTER COLUMN ... SET DEFAULT (Neil) Fail on INSERTs with column lists that don't supply all column values, e.g., INSERT INTO tab (col1, col2) VALUES ('val1'); (Rod) @@ -5533,7 +5533,7 @@ operations on bytea columns (Joe) New pg_settings table to view/modify GUC settings (Joe) Add smart quoting, portability improvements to pg_dump output (Peter) Dump serial columns out as SERIAL (Tom) -Enable large file support, >2G for pg_dump (Peter, Philip Warner, Bruce) +Enable large file support, >2G for pg_dump (Peter, Philip Warner, Bruce) Disallow TRUNCATE on tables that are involved in referential constraints (Rod) Have TRUNCATE also auto-truncate the toast table of the relation (Tom) Add clusterdb utility that will auto-cluster an entire database based on previous CLUSTER operations (Alvaro Herrera) @@ -5597,7 +5597,7 @@ operations on bytea columns (Joe) Add additional encodings: Korean (JOHAB), Thai (WIN874), Vietnamese (TCVN), Arabic (WIN1256), Simplified Chinese (GBK), Korean (UHC) (Eiji Tokuya) Enable locale support by default (Peter) Add locale variables (Peter) -Escape byes >= 0x7f for multibyte in PQescapeBytea/PQunescapeBytea (Tatsuo) +Escape byes >= 0x7f for multibyte in PQescapeBytea/PQunescapeBytea (Tatsuo) Add locale awareness to regular expression character classes Enable multibyte support by default (Tatsuo) Add GB18030 multibyte support (Bill Huang) @@ -5967,7 +5967,7 @@ since PostgreSQL 7.1. Allow EXECUTE of "CREATE TABLE AS ... SELECT" in PL/pgSQL (Tom) Fix for compressed transaction log id wraparound (Tom) -Fix PQescapeBytea/PQunescapeBytea so that they handle bytes > 0x7f (Tatsuo) +Fix PQescapeBytea/PQunescapeBytea so that they handle bytes > 0x7f (Tatsuo) Fix for psql and pg_dump crashing when invoked with non-existent long options (Tatsuo) Fix crash when invoking geometric operators (Tom) Allow OPEN cursor(args) (Tom) @@ -7386,7 +7386,7 @@ Fix mismatched types in CREATE TABLE ... DEFAULT Fix SELECT * FROM pg_class where oid in (0,-1) Fix SELECT COUNT('asdf') FROM pg_class WHERE oid=12 Prevent user who can create databases can modifying pg_database table (Peter E) -Fix btree to give a useful elog when key > 1/2 (page - overhead) (Tom) +Fix btree to give a useful elog when key > 1/2 (page - overhead) (Tom) Fix INSERT of 0.0 into DECIMAL(4,4) field (Tom) Enhancements @@ -7595,7 +7595,7 @@ Fewer fsync writes when fsync is not disabled (Tom) Improved LIKE optimizer estimates (Tom) Prevent fsync in SELECT-only queries (Vadim) Make index creation use psort code, because it is now faster (Tom) -Allow creation of sort temp tables > 1 Gig +Allow creation of sort temp tables > 1 Gig Source Tree Changes ------------------- @@ -9225,7 +9225,7 @@ Check explicitly for points and polygons contained within polygons using an axis-crossing algorithm(Thomas) Add routine to convert circle-box(Thomas) Merge conflicting operators for different geometric data types(Thomas) -Replace distance operator "<===>" with "<->"(Thomas) +Replace distance operator "<===>" with "<->"(Thomas) Replace "above" operator "!^" with ">^" and "below" operator "!|" with "<^"(Thomas) Add routines for text trimming on both ends, substring, and string position(Thomas) Added conversion routines circle(box) and poly(circle)(Thomas) diff --git a/doc/src/sgml/rowtypes.sgml b/doc/src/sgml/rowtypes.sgml index 2cc935db17..e2bfab2b8d 100644 --- a/doc/src/sgml/rowtypes.sgml +++ b/doc/src/sgml/rowtypes.sgml @@ -1,4 +1,4 @@ - + Composite Types @@ -75,7 +75,7 @@ SELECT price_extension(item, 10) FROM on_hand; CREATE TABLE inventory_item ( name text, supplier_id integer REFERENCES suppliers, - price numeric CHECK (price > 0) + price numeric CHECK (price > 0) ); then the same inventory_item composite type shown above would @@ -165,21 +165,21 @@ ROW('', 42, NULL) like: -SELECT item.name FROM on_hand WHERE item.price > 9.99; +SELECT item.name FROM on_hand WHERE item.price > 9.99; This will not work since the name item is taken to be a table name, not a field name, per SQL syntax rules. You must write it like this: -SELECT (item).name FROM on_hand WHERE (item).price > 9.99; +SELECT (item).name FROM on_hand WHERE (item).price > 9.99; or if you need to use the table name as well (for instance in a multi-table query), like this: -SELECT (on_hand.item).name FROM on_hand WHERE (on_hand.item).price > 9.99; +SELECT (on_hand.item).name FROM on_hand WHERE (on_hand.item).price > 9.99; Now the parenthesized object is correctly interpreted as a reference to diff --git a/doc/src/sgml/rules.sgml b/doc/src/sgml/rules.sgml index c04ce33841..513b5f28d6 100644 --- a/doc/src/sgml/rules.sgml +++ b/doc/src/sgml/rules.sgml @@ -1,4 +1,4 @@ - + The Rule System @@ -344,7 +344,7 @@ returns the lower of 2 integer values. We create that as CREATE FUNCTION min(integer, integer) RETURNS integer AS $$ - SELECT CASE WHEN $1 < $2 THEN $1 ELSE $2 END + SELECT CASE WHEN $1 < $2 THEN $1 ELSE $2 END $$ LANGUAGE SQL STRICT; @@ -414,8 +414,8 @@ CREATE VIEW shoe_ready AS min(rsh.sh_avail, rsl.sl_avail) AS total_avail FROM shoe rsh, shoelace rsl WHERE rsl.sl_color = rsh.slcolor - AND rsl.sl_len_cm >= rsh.slminlen_cm - AND rsl.sl_len_cm <= rsh.slmaxlen_cm; + AND rsl.sl_len_cm >= rsh.slminlen_cm + AND rsl.sl_len_cm <= rsh.slmaxlen_cm; The CREATE VIEW command for the @@ -558,7 +558,7 @@ SELECT shoelace.sl_name, shoelace.sl_avail, total number of exactly matching pairs is greater or equal to two. -SELECT * FROM shoe_ready WHERE total_avail >= 2; +SELECT * FROM shoe_ready WHERE total_avail >= 2; shoename | sh_avail | sl_name | sl_avail | total_avail ----------+----------+---------+----------+------------- @@ -576,7 +576,7 @@ SELECT shoe_ready.shoename, shoe_ready.sh_avail, shoe_ready.sl_name, shoe_ready.sl_avail, shoe_ready.total_avail FROM shoe_ready shoe_ready - WHERE shoe_ready.total_avail >= 2; + WHERE shoe_ready.total_avail >= 2; The first rule applied will be the one for the @@ -594,9 +594,9 @@ SELECT shoe_ready.shoename, shoe_ready.sh_avail, min(rsh.sh_avail, rsl.sl_avail) AS total_avail FROM shoe rsh, shoelace rsl WHERE rsl.sl_color = rsh.slcolor - AND rsl.sl_len_cm >= rsh.slminlen_cm - AND rsl.sl_len_cm <= rsh.slmaxlen_cm) shoe_ready - WHERE shoe_ready.total_avail >= 2; + AND rsl.sl_len_cm >= rsh.slminlen_cm + AND rsl.sl_len_cm <= rsh.slmaxlen_cm) shoe_ready + WHERE shoe_ready.total_avail >= 2; Similarly, the rules for shoe and @@ -631,9 +631,9 @@ SELECT shoe_ready.shoename, shoe_ready.sh_avail, FROM shoelace_data s, unit u WHERE s.sl_unit = u.un_name) rsl WHERE rsl.sl_color = rsh.slcolor - AND rsl.sl_len_cm >= rsh.slminlen_cm - AND rsl.sl_len_cm <= rsh.slmaxlen_cm) shoe_ready - WHERE shoe_ready.total_avail > 2; + AND rsl.sl_len_cm >= rsh.slminlen_cm + AND rsl.sl_len_cm <= rsh.slmaxlen_cm) shoe_ready + WHERE shoe_ready.total_avail > 2; @@ -1958,14 +1958,14 @@ Nestloop is -DELETE FROM computer WHERE hostname >= 'old' - AND hostname < 'ole' +DELETE FROM computer WHERE hostname >= 'old' + AND hostname < 'ole' The command added by the rule will be -DELETE FROM software WHERE computer.hostname >= 'old' AND computer.hostname < 'ole' +DELETE FROM software WHERE computer.hostname >= 'old' AND computer.hostname < 'ole' AND software.hostname = computer.hostname; diff --git a/doc/src/sgml/runtime.sgml b/doc/src/sgml/runtime.sgml index 49148f16c2..3e3ce6e866 100644 --- a/doc/src/sgml/runtime.sgml +++ b/doc/src/sgml/runtime.sgml @@ -1,5 +1,5 @@ @@ -4420,8 +4420,8 @@ options SEMMAP=256 proc file system (without reboot). For example, to allow 128 MB: -$ echo 134217728 >/proc/sys/kernel/shmall -$ echo 134217728 >/proc/sys/kernel/shmmax +$ echo 134217728 >/proc/sys/kernel/shmall +$ echo 134217728 >/proc/sys/kernel/shmmax You could put these commands into a script run at boot-time. diff --git a/doc/src/sgml/spi.sgml b/doc/src/sgml/spi.sgml index 1994f7230c..86949a9a43 100644 --- a/doc/src/sgml/spi.sgml +++ b/doc/src/sgml/spi.sgml @@ -1,5 +1,5 @@ @@ -2929,18 +2929,18 @@ execq(text *sql, int cnt) * If this is a SELECT and some rows were fetched, * then the rows are printed via elog(INFO). */ - if (ret == SPI_OK_SELECT && SPI_processed > 0) + if (ret == SPI_OK_SELECT && SPI_processed > 0) { TupleDesc tupdesc = SPI_tuptable->tupdesc; SPITupleTable *tuptable = SPI_tuptable; char buf[8192]; int i, j; - for (j = 0; j < proc; j++) + for (j = 0; j < proc; j++) { HeapTuple tuple = tuptable->vals[j]; - for (i = 1, buf[0] = 0; i <= tupdesc->natts; i++) + for (i = 1, buf[0] = 0; i <= tupdesc->natts; i++) snprintf(buf + strlen (buf), sizeof(buf) - strlen(buf), " %s%s", SPI_getvalue(tuple, tupdesc, i), (i == tupdesc->natts) ? " " : " |"); @@ -2976,15 +2976,15 @@ CREATE FUNCTION execq(text, integer) RETURNS integer Here is a sample session: -=> SELECT execq('CREATE TABLE a (x integer)', 0); +=> SELECT execq('CREATE TABLE a (x integer)', 0); execq ------- 0 (1 row) -=> INSERT INTO a VALUES (execq('INSERT INTO a VALUES (0)', 0)); +=> INSERT INTO a VALUES (execq('INSERT INTO a VALUES (0)', 0)); INSERT 167631 1 -=> SELECT execq('SELECT * FROM a', 0); +=> SELECT execq('SELECT * FROM a', 0); INFO: EXECQ: 0 -- inserted by execq INFO: EXECQ: 1 -- returned by execq and inserted by upper INSERT @@ -2993,13 +2993,13 @@ INFO: EXECQ: 1 -- returned by execq and inserted by upper INSERT 2 (1 row) -=> SELECT execq('INSERT INTO a SELECT x + 2 FROM a', 1); +=> SELECT execq('INSERT INTO a SELECT x + 2 FROM a', 1); execq ------- 1 (1 row) -=> SELECT execq('SELECT * FROM a', 10); +=> SELECT execq('SELECT * FROM a', 10); INFO: EXECQ: 0 INFO: EXECQ: 1 INFO: EXECQ: 2 -- 0 + 2, only one row inserted - as specified @@ -3009,20 +3009,20 @@ INFO: EXECQ: 2 -- 0 + 2, only one row inserted - as specified 3 -- 10 is the max value only, 3 is the real number of rows (1 row) -=> DELETE FROM a; +=> DELETE FROM a; DELETE 3 -=> INSERT INTO a VALUES (execq('SELECT * FROM a', 0) + 1); +=> INSERT INTO a VALUES (execq('SELECT * FROM a', 0) + 1); INSERT 167712 1 -=> SELECT * FROM a; +=> SELECT * FROM a; x --- 1 -- no rows in a (0) + 1 (1 row) -=> INSERT INTO a VALUES (execq('SELECT * FROM a', 0) + 1); +=> INSERT INTO a VALUES (execq('SELECT * FROM a', 0) + 1); INFO: EXECQ: 0 INSERT 167713 1 -=> SELECT * FROM a; +=> SELECT * FROM a; x --- 1 @@ -3031,14 +3031,14 @@ INSERT 167713 1 -- This demonstrates the data changes visibility rule: -=> INSERT INTO a SELECT execq('SELECT * FROM a', 0) * x FROM a; +=> INSERT INTO a SELECT execq('SELECT * FROM a', 0) * x FROM a; INFO: EXECQ: 1 INFO: EXECQ: 2 INFO: EXECQ: 1 INFO: EXECQ: 2 INFO: EXECQ: 2 INSERT 0 2 -=> SELECT * FROM a; +=> SELECT * FROM a; x --- 1 diff --git a/doc/src/sgml/sql.sgml b/doc/src/sgml/sql.sgml index 47b47e7975..b85820c8b1 100644 --- a/doc/src/sgml/sql.sgml +++ b/doc/src/sgml/sql.sgml @@ -1,5 +1,5 @@ @@ -891,7 +891,7 @@ SELECT [ ALL | DISTINCT [ ON ( expression SELECT * FROM PART - WHERE PRICE > 10; + WHERE PRICE > 10; and get the table: @@ -913,7 +913,7 @@ SELECT * FROM PART SELECT PNAME, PRICE FROM PART - WHERE PRICE > 10; + WHERE PRICE > 10; In this case the result is: @@ -939,7 +939,7 @@ SELECT PNAME, PRICE SELECT PNAME, PRICE FROM PART WHERE PNAME = 'Bolt' AND - (PRICE = 0 OR PRICE <= 15); + (PRICE = 0 OR PRICE <= 15); will lead to the result: @@ -959,7 +959,7 @@ SELECT PNAME, PRICE SELECT PNAME, PRICE * 2 AS DOUBLE FROM PART - WHERE PRICE * 2 < 50; + WHERE PRICE * 2 < 50; and we get: @@ -1450,7 +1450,7 @@ SELECT S.SNO, S.SNAME, COUNT(SE.PNO) FROM SUPPLIER S, SELLS SE WHERE S.SNO = SE.SNO GROUP BY S.SNO, S.SNAME - HAVING COUNT(SE.PNO) > 1; + HAVING COUNT(SE.PNO) > 1; and get: @@ -1487,7 +1487,7 @@ SELECT S.SNO, S.SNAME, COUNT(SE.PNO) SELECT * FROM PART - WHERE PRICE > (SELECT PRICE FROM PART + WHERE PRICE > (SELECT PRICE FROM PART WHERE PNAME='Screw'); @@ -1617,11 +1617,11 @@ gives the result: SELECT S.SNO, S.SNAME, S.CITY FROM SUPPLIER S - WHERE S.SNO > 1 + WHERE S.SNO > 1 INTERSECT SELECT S.SNO, S.SNAME, S.CITY FROM SUPPLIER S - WHERE S.SNO < 3; + WHERE S.SNO < 3; gives the result: @@ -1641,11 +1641,11 @@ INTERSECT SELECT S.SNO, S.SNAME, S.CITY FROM SUPPLIER S - WHERE S.SNO > 1 + WHERE S.SNO > 1 EXCEPT SELECT S.SNO, S.SNAME, S.CITY FROM SUPPLIER S - WHERE S.SNO > 3; + WHERE S.SNO > 3; gives the result: diff --git a/doc/src/sgml/trigger.sgml b/doc/src/sgml/trigger.sgml index 0708e0b249..5960ff93ad 100644 --- a/doc/src/sgml/trigger.sgml +++ b/doc/src/sgml/trigger.sgml @@ -1,5 +1,5 @@ @@ -572,13 +572,13 @@ trigf(PG_FUNCTION_ARGS) tupdesc = trigdata->tg_relation->rd_att; /* connect to SPI manager */ - if ((ret = SPI_connect()) < 0) + if ((ret = SPI_connect()) < 0) elog(INFO, "trigf (fired %s): SPI_connect returned %d", when, ret); /* get number of rows in table */ ret = SPI_exec("SELECT count(*) FROM ttest", 0); - if (ret < 0) + if (ret < 0) elog(NOTICE, "trigf (fired %s): SPI_exec returned %d", when, ret); /* count(*) returns int8, so be careful to convert */ @@ -622,57 +622,57 @@ CREATE TRIGGER tafter AFTER INSERT OR UPDATE OR DELETE ON ttest Now you can test the operation of the trigger: -=> INSERT INTO ttest VALUES (NULL); +=> INSERT INTO ttest VALUES (NULL); INFO: trigf (fired before): there are 0 rows in ttest INSERT 0 0 -- Insertion skipped and AFTER trigger is not fired -=> SELECT * FROM ttest; +=> SELECT * FROM ttest; x --- (0 rows) -=> INSERT INTO ttest VALUES (1); +=> INSERT INTO ttest VALUES (1); INFO: trigf (fired before): there are 0 rows in ttest INFO: trigf (fired after ): there are 1 rows in ttest ^^^^^^^^ remember what we said about visibility. INSERT 167793 1 -vac=> SELECT * FROM ttest; +vac=> SELECT * FROM ttest; x --- 1 (1 row) -=> INSERT INTO ttest SELECT x * 2 FROM ttest; +=> INSERT INTO ttest SELECT x * 2 FROM ttest; INFO: trigf (fired before): there are 1 rows in ttest INFO: trigf (fired after ): there are 2 rows in ttest ^^^^^^ remember what we said about visibility. INSERT 167794 1 -=> SELECT * FROM ttest; +=> SELECT * FROM ttest; x --- 1 2 (2 rows) -=> UPDATE ttest SET x = NULL WHERE x = 2; +=> UPDATE ttest SET x = NULL WHERE x = 2; INFO: trigf (fired before): there are 2 rows in ttest UPDATE 0 -=> UPDATE ttest SET x = 4 WHERE x = 2; +=> UPDATE ttest SET x = 4 WHERE x = 2; INFO: trigf (fired before): there are 2 rows in ttest INFO: trigf (fired after ): there are 2 rows in ttest UPDATE 1 -vac=> SELECT * FROM ttest; +vac=> SELECT * FROM ttest; x --- 1 4 (2 rows) -=> DELETE FROM ttest; +=> DELETE FROM ttest; INFO: trigf (fired before): there are 2 rows in ttest INFO: trigf (fired after ): there are 1 rows in ttest INFO: trigf (fired before): there are 1 rows in ttest @@ -680,7 +680,7 @@ INFO: trigf (fired after ): there are 0 rows in ttest ^^^^^^ remember what we said about visibility. DELETE 2 -=> SELECT * FROM ttest; +=> SELECT * FROM ttest; x --- (0 rows) diff --git a/doc/src/sgml/xaggr.sgml b/doc/src/sgml/xaggr.sgml index 8cb0932003..d9c41714df 100644 --- a/doc/src/sgml/xaggr.sgml +++ b/doc/src/sgml/xaggr.sgml @@ -1,5 +1,5 @@ @@ -141,7 +141,7 @@ CREATE AGGREGATE array_accum ( SELECT attrelid::regclass, array_accum(attname) FROM pg_attribute - WHERE attnum > 0 AND attrelid = 'pg_user'::regclass + WHERE attnum > 0 AND attrelid = 'pg_user'::regclass GROUP BY attrelid; attrelid | array_accum @@ -151,7 +151,7 @@ SELECT attrelid::regclass, array_accum(attname) SELECT attrelid::regclass, array_accum(atttypid) FROM pg_attribute - WHERE attnum > 0 AND attrelid = 'pg_user'::regclass + WHERE attnum > 0 AND attrelid = 'pg_user'::regclass GROUP BY attrelid; attrelid | array_accum diff --git a/doc/src/sgml/xfunc.sgml b/doc/src/sgml/xfunc.sgml index cc03bb9af4..821b5353c4 100644 --- a/doc/src/sgml/xfunc.sgml +++ b/doc/src/sgml/xfunc.sgml @@ -1,5 +1,5 @@ @@ -678,7 +678,7 @@ ERROR: could not determine "anyarray"/"anyelement" type because input has type return type, but the converse is not. For example: CREATE FUNCTION is_greater(anyelement, anyelement) RETURNS boolean AS $$ - SELECT $1 > $2; + SELECT $1 > $2; $$ LANGUAGE SQL; SELECT is_greater(1, 2);