mirror of
https://github.com/postgres/postgres.git
synced 2025-10-27 00:12:01 +03:00
Don't use SGML empty tags
For DocBook XML compatibility, don't use SGML empty tags (</>) anymore, replace by the full tag name. Add a warning option to catch future occurrences. Alexander Lakhin, Jürgen Purtz
This commit is contained in:
@@ -29,7 +29,7 @@
|
||||
in the directory <filename>src/tutorial/</filename>. (Binary
|
||||
distributions of <productname>PostgreSQL</productname> might not
|
||||
compile these files.) To use those
|
||||
files, first change to that directory and run <application>make</>:
|
||||
files, first change to that directory and run <application>make</application>:
|
||||
|
||||
<screen>
|
||||
<prompt>$</prompt> <userinput>cd <replaceable>....</replaceable>/src/tutorial</userinput>
|
||||
@@ -50,7 +50,7 @@
|
||||
</screen>
|
||||
|
||||
The <literal>\i</literal> command reads in commands from the
|
||||
specified file. <command>psql</command>'s <literal>-s</> option puts you in
|
||||
specified file. <command>psql</command>'s <literal>-s</literal> option puts you in
|
||||
single step mode which pauses before sending each statement to the
|
||||
server. The commands used in this section are in the file
|
||||
<filename>basics.sql</filename>.
|
||||
@@ -155,8 +155,8 @@ CREATE TABLE weather (
|
||||
<productname>PostgreSQL</productname> supports the standard
|
||||
<acronym>SQL</acronym> types <type>int</type>,
|
||||
<type>smallint</type>, <type>real</type>, <type>double
|
||||
precision</type>, <type>char(<replaceable>N</>)</type>,
|
||||
<type>varchar(<replaceable>N</>)</type>, <type>date</type>,
|
||||
precision</type>, <type>char(<replaceable>N</replaceable>)</type>,
|
||||
<type>varchar(<replaceable>N</replaceable>)</type>, <type>date</type>,
|
||||
<type>time</type>, <type>timestamp</type>, and
|
||||
<type>interval</type>, as well as other types of general utility
|
||||
and a rich set of geometric types.
|
||||
@@ -211,7 +211,7 @@ INSERT INTO weather VALUES ('San Francisco', 46, 50, 0.25, '1994-11-27');
|
||||
|
||||
Note that all data types use rather obvious input formats.
|
||||
Constants that are not simple numeric values usually must be
|
||||
surrounded by single quotes (<literal>'</>), as in the example.
|
||||
surrounded by single quotes (<literal>'</literal>), as in the example.
|
||||
The
|
||||
<type>date</type> type is actually quite flexible in what it
|
||||
accepts, but for this tutorial we will stick to the unambiguous
|
||||
@@ -336,8 +336,8 @@ SELECT city, (temp_hi+temp_lo)/2 AS temp_avg, date FROM weather;
|
||||
</para>
|
||||
|
||||
<para>
|
||||
A query can be <quote>qualified</> by adding a <literal>WHERE</>
|
||||
clause that specifies which rows are wanted. The <literal>WHERE</>
|
||||
A query can be <quote>qualified</quote> by adding a <literal>WHERE</literal>
|
||||
clause that specifies which rows are wanted. The <literal>WHERE</literal>
|
||||
clause contains a Boolean (truth value) expression, and only rows for
|
||||
which the Boolean expression is true are returned. The usual
|
||||
Boolean operators (<literal>AND</literal>,
|
||||
@@ -446,9 +446,9 @@ SELECT DISTINCT city
|
||||
of the same or different tables at one time is called a
|
||||
<firstterm>join</firstterm> query. As an example, say you wish to
|
||||
list all the weather records together with the location of the
|
||||
associated city. To do that, we need to compare the <structfield>city</>
|
||||
column of each row of the <structname>weather</> table with the
|
||||
<structfield>name</> column of all rows in the <structname>cities</>
|
||||
associated city. To do that, we need to compare the <structfield>city</structfield>
|
||||
column of each row of the <structname>weather</structname> table with the
|
||||
<structfield>name</structfield> column of all rows in the <structname>cities</structname>
|
||||
table, and select the pairs of rows where these values match.
|
||||
<note>
|
||||
<para>
|
||||
@@ -483,7 +483,7 @@ SELECT *
|
||||
There is no result row for the city of Hayward. This is
|
||||
because there is no matching entry in the
|
||||
<structname>cities</structname> table for Hayward, so the join
|
||||
ignores the unmatched rows in the <structname>weather</> table. We will see
|
||||
ignores the unmatched rows in the <structname>weather</structname> table. We will see
|
||||
shortly how this can be fixed.
|
||||
</para>
|
||||
</listitem>
|
||||
@@ -520,7 +520,7 @@ SELECT city, temp_lo, temp_hi, prcp, date, location
|
||||
Since the columns all had different names, the parser
|
||||
automatically found which table they belong to. If there
|
||||
were duplicate column names in the two tables you'd need to
|
||||
<firstterm>qualify</> the column names to show which one you
|
||||
<firstterm>qualify</firstterm> the column names to show which one you
|
||||
meant, as in:
|
||||
|
||||
<programlisting>
|
||||
@@ -599,7 +599,7 @@ SELECT *
|
||||
<firstterm>self join</firstterm>. As an example, suppose we wish
|
||||
to find all the weather records that are in the temperature range
|
||||
of other weather records. So we need to compare the
|
||||
<structfield>temp_lo</> and <structfield>temp_hi</> columns of
|
||||
<structfield>temp_lo</structfield> and <structfield>temp_hi</structfield> columns of
|
||||
each <structname>weather</structname> row to the
|
||||
<structfield>temp_lo</structfield> and
|
||||
<structfield>temp_hi</structfield> columns of all other
|
||||
@@ -620,8 +620,8 @@ SELECT W1.city, W1.temp_lo AS low, W1.temp_hi AS high,
|
||||
(2 rows)
|
||||
</programlisting>
|
||||
|
||||
Here we have relabeled the weather table as <literal>W1</> and
|
||||
<literal>W2</> to be able to distinguish the left and right side
|
||||
Here we have relabeled the weather table as <literal>W1</literal> and
|
||||
<literal>W2</literal> to be able to distinguish the left and right side
|
||||
of the join. You can also use these kinds of aliases in other
|
||||
queries to save some typing, e.g.:
|
||||
<programlisting>
|
||||
@@ -644,7 +644,7 @@ SELECT *
|
||||
<para>
|
||||
Like most other relational database products,
|
||||
<productname>PostgreSQL</productname> supports
|
||||
<firstterm>aggregate functions</>.
|
||||
<firstterm>aggregate functions</firstterm>.
|
||||
An aggregate function computes a single result from multiple input rows.
|
||||
For example, there are aggregates to compute the
|
||||
<function>count</function>, <function>sum</function>,
|
||||
@@ -747,7 +747,7 @@ SELECT city, max(temp_lo)
|
||||
</screen>
|
||||
|
||||
which gives us the same results for only the cities that have all
|
||||
<structfield>temp_lo</> values below 40. Finally, if we only care about
|
||||
<structfield>temp_lo</structfield> values below 40. Finally, if we only care about
|
||||
cities whose
|
||||
names begin with <quote><literal>S</literal></quote>, we might do:
|
||||
|
||||
@@ -871,7 +871,7 @@ DELETE FROM <replaceable>tablename</replaceable>;
|
||||
</synopsis>
|
||||
|
||||
Without a qualification, <command>DELETE</command> will
|
||||
remove <emphasis>all</> rows from the given table, leaving it
|
||||
remove <emphasis>all</emphasis> rows from the given table, leaving it
|
||||
empty. The system will not request confirmation before
|
||||
doing this!
|
||||
</para>
|
||||
|
||||
Reference in New Issue
Block a user