_seq, where table and serialcolumn are the
names of your table and your SERIAL column, respectively.
- Alternatively, you could retrieve the just-assigned SERIAL value with
- the currval() function after it was inserted by default, e.g.,
+ Alternatively, you could retrieve the assigned SERIAL value with the
+ currval() function after it was inserted by default, e.g.,
INSERT INTO person (name) VALUES ('Blaise Pascal');
$newID = currval('person_id_seq');
Finally, you could use the OID returned from the INSERT statement to
- lookup the default value, though this is probably the least portable
+ look up the default value, though this is probably the least portable
approach. In Perl, using DBI with Edmund Mergl's DBD::Pg module, the
oid value is made available via $sth->{pg_oid_status} after
$sth->execute().
@@ -880,8 +880,8 @@ BYTEA bytea variable-length array of bytes
OIDs are PostgreSQL's answer to unique row ids. Every row that is
created in PostgreSQL gets a unique OID. All OIDs generated during
initdb are less than 16384 (from backend/access/transam.h). All
- user-created OIDs are equal or greater that this. By default, all
- these OIDs are unique not only within a table, or database, but unique
+ user-created OIDs are equal to or greater than this. By default, all
+ these OIDs are unique not only within a table or database, but unique
within the entire PostgreSQL installation.
PostgreSQL uses OIDs in its internal system tables to link rows
@@ -965,8 +965,8 @@ BYTEA bytea variable-length array of bytes
4.23) Why are my subqueries using IN so slow?
- Currently, we join subqueries to outer queries by sequential scanning
- the result of the subquery for each row of the outer query. A
+ Currently, we join subqueries to outer queries by sequentially
+ scanning the result of the subquery for each row of the outer query. A
workaround is to replace IN with EXISTS:
SELECT *
FROM tab
@@ -1001,7 +1001,7 @@ BYTEA bytea variable-length array of bytes
dump core?
The problem could be a number of things. Try testing your user-defined
- function in a stand alone test program first.
+ function in a stand-alone test program first.
5.2) What does the message "NOTICE:PortalHeapMemoryFree: 0x402251d0 not in
alloc set!" mean?
diff --git a/doc/src/FAQ/FAQ.html b/doc/src/FAQ/FAQ.html
index 4a39a54b861..0c161946e5c 100644
--- a/doc/src/FAQ/FAQ.html
+++ b/doc/src/FAQ/FAQ.html
@@ -861,7 +861,7 @@ The row length limit will be removed in 7.1.
4.7)How much database disk space is required to
store data from a typical text file?
-A PostgreSQL database may need six and a half times the disk space
+A PostgreSQL database may need six-and-a-half times the disk space
required to store the data in a flat file.
Consider a file of 300,000 lines with two integers on each line. The
@@ -914,7 +914,7 @@ sequential scan would be faster.
For column-specific optimization statistics, use VACUUM
ANALYZE. VACUUM ANALYZE is important for complex
-multi-join queries, so the optimizer can estimate the number of rows
+multijoin queries, so the optimizer can estimate the number of rows
returned from each table, and choose the proper join order. The backend
does not keep track of column statistics on its own, so VACUUM
ANALYZE must be run to collect them periodically.
@@ -941,20 +941,20 @@ An R-tree index is used for indexing spatial data. A hash index can't
handle range searches. A B-tree index only handles range searches in a
single dimension. R-tree's can handle multi-dimensional data. For
example, if an R-tree index can be built on an attribute of type point,
-the system can more efficient answer queries like select all points
-within a bounding rectangle.
+the system can more efficiently answer queries such as "select all points
+within a bounding rectangle."
-The canonical paper that describes the original R-Tree design is:
+The canonical paper that describes the original R-tree design is:
-Guttman, A. "R-Trees: A Dynamic Index Structure for Spatial Searching."
+Guttman, A. "R-trees: A Dynamic Index Structure for Spatial Searching."
Proc of the 1984 ACM SIGMOD Int'l Conf on Mgmt of Data, 45-57.
You can also find this paper in Stonebraker's "Readings in Database
Systems"
-Builtin R-Trees can handle polygons and boxes. In theory, R-trees can
+Built-in R-trees can handle polygons and boxes. In theory, R-trees can
be extended to handle higher number of dimensions. In practice,
-extending R-trees require a bit of work and we don't currently have any
+extending R-trees requires a bit of work and we don't currently have any
documentation on how to do it.
@@ -964,13 +964,13 @@ Optimization?
The GEQO module speeds query
optimization when joining many tables by means of a Genetic
Algorithm (GA). It allows the handling of large join queries through
-non-exhaustive search.
+nonexhaustive search.
4.13) How do I do regular expression searches and
case-insensitive regular expression searches?
-The ~ operator does regular-expression matching, and ~*
-does case-insensitive regular-expression matching. There is no
+The ~ operator does regular expression matching, and ~*
+does case-insensitive regular expression matching. There is no
case-insensitive variant of the LIKE operator, but you can get the
effect of case-insensitive LIKE with this:
@@ -999,7 +999,7 @@ BYTEA bytea variable-length array of bytes
You will see the internal name when examining system catalogs
and in some error messages.
-The last four types above are "varlena" types (i.e. the first four bytes
+The last four types above are "varlena" types (i.e., the first four bytes
are the length, followed by the data). char(#) allocates the
maximum number of bytes no matter how much data is stored in the field.
text, varchar(#), and bytea all have variable length on the disk,
@@ -1043,17 +1043,26 @@ One approach is to to retrieve the next SERIAL value from the sequence object wi
$newSerialID = nextval('person_id_seq');
INSERT INTO person (id, name) VALUES ($newSerialID, 'Blaise Pascal');
-You would then also have the new value stored in $newSerialID
for use in other queries (e.g., as a foreign key to the person
table). Note that the name of the automatically-created SEQUENCE object will be named <table>_<serialcolumn>_seq, where table and serialcolumn are the names of your table and your SERIAL column, respectively.
+
+You would then also have the new value stored in
+$newSerialID
for use in other queries (e.g., as a foreign
+key to the person
table). Note that the name of the
+automatically created SEQUENCE object will be named
+<table>_<serialcolumn>_seq, where
+table and serialcolumn are the names of your table and
+your SERIAL column, respectively.
+
-Alternatively, you could retrieve the just-assigned SERIAL value with the currval() function after it was inserted by default, e.g.,
+Alternatively, you could retrieve the assigned SERIAL value with the currval() function after it was inserted by default, e.g.,
INSERT INTO person (name) VALUES ('Blaise Pascal');
$newID = currval('person_id_seq');
-Finally, you could use the OID returned from the
-INSERT statement to lookup the default value, though this is probably
-the least portable approach. In Perl, using DBI with Edmund Mergl's
-DBD::Pg module, the oid value is made available via
+
+Finally, you could use the OID
+returned from the INSERT statement to look up the default value, though
+this is probably the least portable approach. In Perl, using DBI with
+Edmund Mergl's DBD::Pg module, the oid value is made available via
$sth->{pg_oid_status} after $sth->execute().
4.16.3) Don't currval() and nextval() lead to
@@ -1065,12 +1074,13 @@ No. This is handled by the backends.
4.17) What is an OID? What is a
TID?
-OIDs are PostgreSQL's answer to unique row ids. Every row that is
-created in PostgreSQL gets a unique OID. All OIDs generated during
-initdb are less than 16384 (from backend/access/transam.h). All
-user-created OIDs are equal or greater that this. By default, all these
-OIDs are unique not only within a table, or database, but unique within
-the entire PostgreSQL installation.
+OIDs are PostgreSQL's answer to unique row ids. Every
+row that is created in PostgreSQL gets a unique OID. All
+OIDs generated during initdb are less than 16384
+(from backend/access/transam.h). All user-created
+OIDs are equal to or greater than this. By default, all
+these OIDs are unique not only within a table or
+database, but unique within the entire PostgreSQL installation.
PostgreSQL uses OIDs in its internal system tables to link rows between
tables. These OIDs can be used to identify specific user rows and used
@@ -1175,7 +1185,7 @@ Use now():
4.23) Why are my subqueries using
IN
so slow?
-Currently, we join subqueries to outer queries by sequential scanning
+Currently, we join subqueries to outer queries by sequentially scanning
the result of the subquery for each row of the outer query. A workaround
is to replace IN
with EXISTS
:
@@ -1216,12 +1226,12 @@ does an outer join of the two tables:
I run it in psql, why does it dump core?
The problem could be a number of things. Try testing your user-defined
-function in a stand alone test program first.
+function in a stand-alone test program first.
5.2) What does the message
"NOTICE:PortalHeapMemoryFree: 0x402251d0 not in alloc set!" mean?
-You are pfree'ing something that was not palloc'ed.
+You are pfree'ing something that was not palloc'ed.
Beware of mixing malloc/free and palloc/pfree.