Let's create two classes. The capitals class contains
- state capitals which are also cities. Naturally, the
+ state capitals that are also cities. Naturally, the
capitals class should inherit from cities.
the parser as input and steps recursively through it. If
a SelectStmt node is found, it is transformed
to a Query
- node which will be the top most node of the new data structure. Figure
+ node that will be the top most node of the new data structure. Figure
\ref{transformed} shows the transformed data structure (the part
for the transformed where clause is given in figure
\ref{transformed_where} because there was not enough space to show all
created containing the relation name, the alias name and
the relation id. From now on the relation ids are used to
refer to the
relations given in the query. All
RTE nodes
- are collected in the range table entry list which is connected
+ are collected in the range table entry list that is connected
to the field rtable of the Query node. If a name of a
relation that is not known to the system is detected in the query an
error will be returned and the query processing will be aborted.
- The top node of the plan is a MergeJoin node which has two
+ The top node of the plan is a MergeJoin node that has two
successors, one attached to the field lefttree and the second
attached to the field righttree. Each of the subnodes represents
one relation of the join. As mentioned above a merge sort
A check is made that every attribute grouped for appears only without
an {\it aggregate function} in the {\it targetlist} and that every
-attribute which appears without an {\it aggregate function} in the
+attribute that appears without an {\it aggregate function} in the
{\it targetlist} is grouped for.
%
transformation of the {\it operator tree} for the {\it where clause}. This
is possible because both trees are built up by the same grammar rules
of the {\it parser} and are therefore compatible. Additional checks
-which make sure that the {\it having clause} involves at least one
+that make sure that the {\it having clause} involves at least one
{\it aggregate function} etc. are performed at a later point in time
in the {\it planner/optimizer} stage. \\
\\
functions. Every added source line will be marked by a {\tt '+'} at the
beginning of the line and every changed source line will be marked by
a {\tt '!'} throughout the following code listings. Whenever a part of
-the code which is not relevant at the moment is skipped, three
+the code that is not relevant at the moment is skipped, three
vertical dots are inserted instead.
%
\pagebreak
Unfortunately this is not the only thing to do. Remember from section
\ref{aggregates} {\it How Aggregate Functions are Implemented} that
-the {\it targetlist} is searched for {\it aggregate functions} which
+the {\it targetlist} is searched for {\it aggregate functions} that
are appended to a list that will be attached to the field {\tt aggs}
of the {\tt AGG} node. This was sufficient as long as {\it aggregate
functions} have only been allowed to appear within the {\it
%
\end{itemize}
%
-Here is a part of the grammar which is responsible for {\tt select}
+Here is a part of the grammar that is responsible for {\tt select}
statements having the code building up the data structures inserted:
%
\pagebreak
stored in the attribute is the OID of a tuple in the
pg_proc catalog. The
pg_proc tuple contains the query
- string which defines this set - i.e., the query to run to get
+ string that defines this set - i.e., the query to run to get
the set. So the atttypid (see
above) refers to the type returned by this query, but the
actual length of this attribute is the length (size) of an
and if you want to build a static binary to move to systems
- which may not have Modula-3 installed, try:
+ that may not have Modula-3 installed, try:
# make M3FLAGS="-DNOGUI -DSTATIC"
of
SQL92 are also supported.
Although we strive for
SQL92 compliance,
there are some aspects of the standard
- which are ill considered and which should not live through subsequent standards.
+ that are ill considered and which should not live through subsequent standards.
Postgres will not make great efforts to
conform to these features; however, these tend to apply in little-used
or obsure cases, and a typical user is not likely to run into them.
This type is defined by SQL92, but the definition exhibits
- fundamental deficiencies which renders the type nearly useless. In
+ fundamental deficiencies that render the type nearly useless. In
most cases, a combination of date,
time, and timestamp
should provide a complete range of date/time functionality
1999-01-08 04:05:06 -8:00
- is a valid
timestamp value
, which is
ISO-compliant.
+ is a valid
timestamp value
that is
ISO-compliant.
In addition, the wide-spread format
To address these difficulties, we recommend using date/time
- types which contain both date and time when using time zones. We
+ types that contain both date and time when using time zones. We
recommend not using the SQL92 type TIME
WITH TIME ZONE (though it is supported by
Postgres for legacy applications and
Box
- Boxes are represented by pairs of points which are opposite
+ Boxes are represented by pairs of points that are opposite
corners of the box.
-
+
Documentation
JadeTeX does not at the time of
writing come with much of an installation guide, but there is a
- makefile which shows what is needed. It
+ makefile that shows what is needed. It
also includes a directory cooked, wherein
you'll find some of the macro packages it needs, but not all, and
not complete -- at least last we looked.
Not all documents have figures.
You can grep the
SGML source files for
the string "graphic" to identify those parts of the
- documentation which may have figures. A few figures are replicated in
+ documentation that may have figures. A few figures are replicated in
various parts of the documentation.
- Lop off the parts of the document which are not needed.
+ Lop off the parts of the document that are not needed.
Indexes are commonly used to enhance database
performance. They should be defined on table columns (or class
- attributes) which are used as qualifications in repetitive queries.
+ attributes) that are used as qualifications in repetitive queries.
Inappropriate use will result in slower performance, since update
and insertion times are increased in the presence of indices.
Thus, you may query a table by any combination of its columns, despite the
fact that you don't have an index on these columns. The indexes are merely
- an implementational aid
which each
RDBMS offers
+ an implementational aid
that each
RDBMS offers
you, in order to cause
commonly used queries to be done more efficiently.
- So, if you want to use a combination of fields which is not unique as a
+ So, if you want to use a combination of fields that is not unique as a
secondary key, you really don't have to specify anything - just start
retrieving by that combination! However, if you want to make the retrieval
efficient, you'll have to resort to the means your
- be it an index, my imaginary MEMSTORE command, or an intelligent
- which creates indices without your knowledge based on the fact that you have
+ that creates indices without your knowledge based on the fact that you have
sent it many queries based on a specific combination of keys... (It learns
from experience).
-
+
PostgreSQL>]]> Installation Instructions
- On systems
which have
PostgreSQL> started at boot time, there is
+ On systems
that have
PostgreSQL> started at boot time, there is
probably a start-up file that will accomplish the same thing. For
example, on a Red Hat Linux system one might find that
public class PGpath extends PGobject implements Serializable,
Cloneable
- This implements a path (a multiple segmented line, which may be
+ This implements a path (a multiply segmented line, which may be
closed)
Variables
Thus, you may query a table by any combination of its columns, despite the
fact that you don't have an index on these columns. The indexes are merely
- an implementational aid
which each
RDBMS offers you, in order to cause
+ an implementational aid
that each
RDBMS offers you, in order to cause
commonly used queries to be done more efficiently. Some
RDBMS may give you
additional measures, such as keeping a key stored in main memory. They will
have a special command, for example
sequential scan!
- So, if you want to use a combination of fields which is not unique as a
+ So, if you want to use a combination of fields that is not unique as a
secondary key, you really don't have to specify anything - just start
retrieving by that combination! However, if you want to make the retrieval
efficient, you'll have to resort to the means your
RDBMS provider gives you
- be it an index, my imaginary MEMSTORE command, or an intelligent
- which creates indices without your knowledge based on the fact that you have
+ that creates indices without your knowledge based on the fact that you have
sent it many queries based on a specific combination of keys... (It learns
from experience).
libpq++ is the C++ API to
- libpq++ is a set of classes which allow
+ libpq++ is a set of classes that allow
client programs to connect to the
Postgres backend server. These connections
come in two forms: a Database Class and a Large Object class.
- Frontend programs which use libpq must include the
+ Frontend programs that use libpq must include the
header file libpq-fe.h and must link with the
libpq library.
specified, the value for hostaddr gives the remote address; the value
for host is ignored, unless Kerberos is used, in which case that value
is used for Kerberos authentication. Note that authentication is likely
- to fail if libpq is passed a host name which is not the name of the
+ to fail if libpq is passed a host name that is not the name of the
machine at hostaddr.
ODBC (Open Database Connectivity) is an abstract
- which allows you to write applications which can interoperate
+ that allows you to write applications that can interoperate
with various
RDBMS servers.
ODBC provides a product-neutral interface
between frontend applications and database servers,
- allowing a user or developer to write applications which are
+ allowing a user or developer to write applications that are
transportable between servers from different manufacturers..
For example. you could have
MS SQL Server
- and
Postgres servers
which have
+ and
Postgres servers
that have
exactly the same data. Using
ODBC,
your Windows application would make exactly the
same calls and the back end data source would look the same (to the Windows
byte
is assumed to contain 8 bits. In addition, the term
item
-refers to data
which is stored in
Postgres classes.
+refers to data
that is stored in
Postgres classes.
special)
represent byte offsets to the start of unallocated space, to the end
of unallocated space, and to the start of special space.
-Special space is a region at the end of the page which is allocated at
-page initialization time and which contains information specific to an
+Special space is a region at the end of the page that is allocated at
+page initialization time and contains information specific to an
access method. The last 2 bytes of the page header,
opaque,
encode the page size and information on the internal fragmentation of
PL/Perl allows you to write functions in the Perl programming
- language which may be used in SQL queries as if they were built into
+ language that may be used in SQL queries as if they were built into
- Here is an example of a function which will not work because file
+ Here is an example of a function that will not work because file
system operations are not allowed for security reasons:
CREATE FUNCTION badfunc() RETURNS integer AS '
All expressions used in PL/pgSQL statements are processed using
- the backends executor. Expressions which appear to contain
+ the backends executor. Expressions that appear to contain
constants may in fact require run-time evaluation (e.g. 'now' for the
datetime type) so
it is impossible for the PL/pgSQL parser
SELECT max(temp_lo) FROM weather;
- If we want to know which city (or cities) that reading occurred in,
+ If we want to know what city (or cities) that reading occurred in,
we might try
-
+
Regression Tests
platform system routines. In the latter case, the messages may
vary between platforms, but should reflect similar
information. These differences in messages will result in a
- failed
regression test which can be validated by
+ failed
regression test that can be validated by
inspection.
- There appear to be some systems which do not accept the
+ There appear to be some systems that do not accept the
recommended syntax for explicitly setting the local time zone
rules; you may need to use a different PGTZ
setting on such machines.
polygons whose vertices are represented as pairs of double
precision numbers (decimal latitude and
longitude). Initially, some tables are created and loaded with
- geographic data, then some views are created which join two
+ geographic data, then some views are created that join two
tables using the polygon intersection operator
(##), then a select is done on the view.
-Array of numbers of the attributes which are to be changed
+Array of numbers of the attributes that are to be changed
Server allocates memory in memory contexts in such way that allocations
made in one context may be freed by context destruction without affecting
allocations made in other contexts. All allocations (via palloc, etc) are
-made in the context which are chosen as current one. You'll get
+made in the context that is chosen as the current one. You'll get
unpredictable results if you'll try to free (or reallocate) memory allocated
not in current context.
- Changes made by query Q are visible by queries which are started after
+ Changes made by query Q are visible to queries that are started after
query Q, no matter whether they are started inside Q (during the execution
of Q) or after Q is done.
The following are
Postgres
- reserved words
which are neither
SQL92
+ reserved words
that are neither
SQL92
nor
SQL3 reserved words. These are allowed
to be present as column labels, but not as identifiers:
The following are
Postgres
- reserved words
which are also
SQL92
- or
SQL3 reserved words, and
which
+ reserved words
that are also
SQL92
+ or
SQL3 reserved words, and
that
are allowed to be present as column labels, but not as identifiers:
The following are
Postgres
- reserved words
which are also
SQL92
+ reserved words
that are also
SQL92
- The following are
SQL92 reserved key words
which
- are not
Postgres reserved key words, but
which
+ The following are
SQL92 reserved key words
that
+ are not
Postgres reserved key words, but
that
if used as function names are always translated into the function
CHAR_LENGTH:
The following are
SQL92 or
SQL3
- reserved key words which
+ reserved key words that
are not
Postgres reserved key words, but
if used as type names are always translated into an alternate, native type:
The following are either
SQL92
or
SQL3 reserved key words
-
which are not key words in
Postgres.
+
that are not key words in
Postgres.
These have no proscribed usage in
Postgres
at the time of writing (version 7.0) but may become reserved key words in the
future:
The following are
Postgres
- non-reserved key words
which are neither
SQL92
+ non-reserved key words
that are neither
SQL92
nor
SQL3 non-reserved key words:
The following are
Postgres
- non-reserved key words
which are
SQL92
+ non-reserved key words
that are
SQL92
or
SQL3 reserved key words:
The following are
Postgres
- non-reserved key words
which are also either
SQL92
+ non-reserved key words
that are also either
SQL92
or
SQL3 non-reserved key words:
The following are either
SQL92
- or
SQL3 non-reserved key words
which are not
+ or
SQL3 non-reserved key words
that are not
key words of any kind in
Postgres:
where the comment begins with "/*" and extends
to the matching occurrence of "*/". These block
comments nest, as specified in SQL99, so that one can comment out
- larger blocks of code which may contain existing block comments.
+ larger blocks of code that may contain existing block comments.
-Changes made by query Q are visible by queries which are started after
+Changes made by query Q are visible by queries that are started after
query Q, no matter whether they are started inside Q (during the
execution of Q) or after Q is done.
SQL is a strongly typed language. That is, every data item
has an associated data type which determines its behavior and allowed usage.
-
Postgres has an extensible type system
which is
+
Postgres has an extensible type system
that is
much more general and flexible than other
RDBMS implementations.
Hence, most type conversion behavior in
Postgres
should be governed by general rules rather than by ad-hoc heuristics to allow
-Run through all candidates and keep those which accept preferred types at
+Run through all candidates and keep those that accept preferred types at
the most positions where type coercion will be required.
Keep all candidates if none accept preferred types.
If only one candidate remains, use it; else continue to the next step.
-Run through all candidates and keep those which accept preferred types at
+Run through all candidates and keep those that accept preferred types at
the most positions where type coercion will be required.
Keep all candidates if none accept preferred types.
If only one candidate remains, use it; else continue to the next step.
Internal Functions
- Internal functions are functions written in C which have been statically
+ Internal functions are functions written in C that have been statically
linked into the
Postgres backend
process. The AS
clause gives the C-language name of the function, which need not be the
- The string which specifies the object file (the first string in the AS
+ The string that specifies the object file (the first string in the AS
clause) should be the full path of the object
code file for the function, bracketed by single quote marks. If a
link symbol is given in the AS clause, the link symbol should also be