mirror of
https://github.com/postgres/postgres.git
synced 2025-07-14 08:21:07 +03:00
Fix markup to allow doc building.
This commit is contained in:
@ -1,5 +1,5 @@
|
|||||||
<!--
|
<!--
|
||||||
$Header: /cvsroot/pgsql/doc/src/sgml/Attic/inherit.sgml,v 1.7 2000/05/02 20:01:51 thomas Exp $
|
$Header: /cvsroot/pgsql/doc/src/sgml/Attic/inherit.sgml,v 1.7.2.1 2000/06/14 13:18:59 thomas Exp $
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<chapter id="inherit">
|
<chapter id="inherit">
|
||||||
@ -40,6 +40,7 @@ CREATE TABLE capitals (
|
|||||||
The inheritance hierarchy is a actually a directed acyclic graph.
|
The inheritance hierarchy is a actually a directed acyclic graph.
|
||||||
</para>
|
</para>
|
||||||
</note>
|
</note>
|
||||||
|
</para>
|
||||||
|
|
||||||
For example, the following query finds
|
For example, the following query finds
|
||||||
all the cities that are situated at an attitude of 500ft or higher:
|
all the cities that are situated at an attitude of 500ft or higher:
|
||||||
@ -87,6 +88,7 @@ SELECT c.name, c.altitude
|
|||||||
<command>ALTER TABLE</command>.
|
<command>ALTER TABLE</command>.
|
||||||
</para>
|
</para>
|
||||||
</chapter>
|
</chapter>
|
||||||
|
<para>
|
||||||
|
|
||||||
<!-- Keep this comment at the end of the file
|
<!-- Keep this comment at the end of the file
|
||||||
Local variables:
|
Local variables:
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<!--
|
<!--
|
||||||
$Header: /cvsroot/pgsql/doc/src/sgml/query.sgml,v 1.11 2000/04/11 05:39:06 thomas Exp $
|
$Header: /cvsroot/pgsql/doc/src/sgml/query.sgml,v 1.11.2.1 2000/06/14 13:18:59 thomas Exp $
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<chapter id="query">
|
<chapter id="query">
|
||||||
@ -154,7 +154,7 @@ INSERT INTO weather
|
|||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
You can also use the <command>COPY</command> command to perform load large
|
You can also use <command>COPY</command> to load large
|
||||||
amounts of data from flat (<acronym>ASCII</acronym>) files.
|
amounts of data from flat (<acronym>ASCII</acronym>) files.
|
||||||
This is usually faster because the data is read (or written) as a
|
This is usually faster because the data is read (or written) as a
|
||||||
single atomic
|
single atomic
|
||||||
|
@ -1,87 +1,83 @@
|
|||||||
<!--
|
<!--
|
||||||
$Header: /cvsroot/pgsql/doc/src/sgml/release.sgml,v 1.49.2.5 2000/06/05 10:59:16 momjian Exp $
|
$Header: /cvsroot/pgsql/doc/src/sgml/release.sgml,v 1.49.2.6 2000/06/14 13:18:59 thomas Exp $
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<chapter id="release">
|
<chapter id="release">
|
||||||
<title>Release Notes</title>
|
<title>Release Notes</title>
|
||||||
|
|
||||||
<sect1>
|
<sect1>
|
||||||
<title>Release 7.0.2</title>
|
<title>Release 7.0.2</title>
|
||||||
<!--
|
<!--
|
||||||
<docinfo>
|
<docinfo>
|
||||||
<authorgroup>
|
<authorgroup>
|
||||||
<author>
|
<author>
|
||||||
<firstname>Bruce</firstname>
|
<firstname>Bruce</firstname>
|
||||||
<surname>Momjian</surname>
|
<surname>Momjian</surname>
|
||||||
</author>
|
</author>
|
||||||
</authorgroup>
|
</authorgroup>
|
||||||
<date>2000-06-05</date>
|
<date>2000-06-05</date>
|
||||||
</docinfo>
|
</docinfo>
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
2000-06-05
|
Release date 2000-06-05. This is a repackaging of 7.0.1 with added documentation.
|
||||||
</para>
|
</para>
|
||||||
<para>
|
|
||||||
This is a repackaging of 7.0.1 with added documentation.
|
|
||||||
</para>
|
|
||||||
|
|
||||||
|
|
||||||
<sect2>
|
<sect2>
|
||||||
<title>Migration to v7.0.2</title>
|
<title>Migration to v7.0.2</title>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
A dump/restore is <emphasis>not</emphasis> required for those running
|
A dump/restore is <emphasis>not</emphasis> required for those running
|
||||||
7.*.
|
v7.*.
|
||||||
</para>
|
</para>
|
||||||
</sect2>
|
</sect2>
|
||||||
<sect2>
|
|
||||||
<title>Changes</title>
|
|
||||||
|
|
||||||
<para>
|
<sect2>
|
||||||
<programlisting>
|
<title>Changes</title>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
<programlisting>
|
||||||
Added documentation to tarball.
|
Added documentation to tarball.
|
||||||
</programlisting>
|
</programlisting>
|
||||||
</para>
|
</para>
|
||||||
</sect2>
|
</sect2>
|
||||||
</sect1>
|
</sect1>
|
||||||
|
|
||||||
|
|
||||||
<sect1>
|
<sect1>
|
||||||
<title>Release 7.0.1</title>
|
<title>Release 7.0.1</title>
|
||||||
<!--
|
<!--
|
||||||
<docinfo>
|
<docinfo>
|
||||||
<authorgroup>
|
<authorgroup>
|
||||||
<author>
|
<author>
|
||||||
<firstname>Bruce</firstname>
|
<firstname>Bruce</firstname>
|
||||||
<surname>Momjian</surname>
|
<surname>Momjian</surname>
|
||||||
</author>
|
</author>
|
||||||
</authorgroup>
|
</authorgroup>
|
||||||
<date>2000-06-01</date>
|
<date>2000-06-01</date>
|
||||||
</docinfo>
|
</docinfo>
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
2000-06-01
|
Release date 2000-06-01.
|
||||||
</para>
|
This is a cleanup release for 7.0.
|
||||||
<para>
|
</para>
|
||||||
This is basically a cleanup release for 7.0.
|
|
||||||
</para>
|
|
||||||
|
|
||||||
|
<sect2>
|
||||||
|
<title>Migration to v7.0.1</title>
|
||||||
|
|
||||||
<sect2>
|
<para>
|
||||||
<title>Migration to v7.0.1</title>
|
A dump/restore is <emphasis>not</emphasis> required for those running
|
||||||
|
v7.0.
|
||||||
|
</para>
|
||||||
|
</sect2>
|
||||||
|
|
||||||
<para>
|
<sect2>
|
||||||
A dump/restore is <emphasis>not</emphasis> required for those running
|
<title>Changes</title>
|
||||||
7.0.
|
|
||||||
</para>
|
|
||||||
</sect2>
|
|
||||||
<sect2>
|
|
||||||
<title>Changes</title>
|
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
<programlisting>
|
<programlisting>
|
||||||
Fix many CLUSTER failures (Tom)
|
Fix many CLUSTER failures (Tom)
|
||||||
Allow ALTER TABLE RENAME works on indexes (Tom)
|
Allow ALTER TABLE RENAME works on indexes (Tom)
|
||||||
Fix plpgsql to handle datetime->timestamp and timespan->interval (Bruce)
|
Fix plpgsql to handle datetime->timestamp and timespan->interval (Bruce)
|
||||||
@ -106,11 +102,10 @@ Fix too long syslog message (Tatsuo)
|
|||||||
Fix problem with quoted indexes that are too long (Tom)
|
Fix problem with quoted indexes that are too long (Tom)
|
||||||
JDBC ResultSet.getTimestamp() fix (Gregory Krasnow & Floyd Marinescu)
|
JDBC ResultSet.getTimestamp() fix (Gregory Krasnow & Floyd Marinescu)
|
||||||
ecpg changes (Michael)
|
ecpg changes (Michael)
|
||||||
</programlisting>
|
</programlisting>
|
||||||
</para>
|
</para>
|
||||||
</sect2>
|
</sect2>
|
||||||
</sect1>
|
</sect1>
|
||||||
|
|
||||||
|
|
||||||
<sect1>
|
<sect1>
|
||||||
<title>Release 7.0</title>
|
<title>Release 7.0</title>
|
||||||
@ -126,9 +121,7 @@ ecpg changes (Michael)
|
|||||||
</docinfo>
|
</docinfo>
|
||||||
-->
|
-->
|
||||||
<para>
|
<para>
|
||||||
2000-05-08
|
Released 2000-05-08.
|
||||||
</para>
|
|
||||||
<para>
|
|
||||||
This release contains improvements in many areas, demonstrating
|
This release contains improvements in many areas, demonstrating
|
||||||
the continued growth of <productname>PostgreSQL</productname>.
|
the continued growth of <productname>PostgreSQL</productname>.
|
||||||
There are more improvements and fixes in 7.0 than in any previous
|
There are more improvements and fixes in 7.0 than in any previous
|
||||||
@ -287,6 +280,8 @@ Ack! This isn't yet in the code?? - thomas 2000-04-30
|
|||||||
</sect2>
|
</sect2>
|
||||||
|
|
||||||
<sect2>
|
<sect2>
|
||||||
|
<title>Changes</title>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
<programlisting>
|
<programlisting>
|
||||||
Bug Fixes
|
Bug Fixes
|
||||||
@ -611,87 +606,84 @@ New multibyte encodings
|
|||||||
</sect2>
|
</sect2>
|
||||||
</sect1>
|
</sect1>
|
||||||
|
|
||||||
<sect1>
|
<sect1>
|
||||||
<title>Release 6.5.3</title>
|
<title>Release 6.5.3</title>
|
||||||
<!--
|
<!--
|
||||||
<docinfo>
|
<docinfo>
|
||||||
<authorgroup>
|
<authorgroup>
|
||||||
<author>
|
<author>
|
||||||
<firstname>Bruce</firstname>
|
<firstname>Bruce</firstname>
|
||||||
<surname>Momjian</surname>
|
<surname>Momjian</surname>
|
||||||
</author>
|
</author>
|
||||||
</authorgroup>
|
</authorgroup>
|
||||||
<date>1999-10-13</date>
|
<date>1999-10-13</date>
|
||||||
</docinfo>
|
</docinfo>
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
1999-10-13
|
Released 1999-10-13.
|
||||||
</para>
|
This is basically a cleanup release for 6.5.2. We have added a new
|
||||||
<para>
|
pgaccess that was missing in 6.5.2, and installed an NT-specific fix.
|
||||||
This is basically a cleanup release for 6.5.2. We have added a new
|
</para>
|
||||||
pgaccess that was missing in 6.5.2, and installed an NT-specific fix.
|
|
||||||
</para>
|
|
||||||
|
|
||||||
|
|
||||||
<sect2>
|
<sect2>
|
||||||
<title>Migration to v6.5.3</title>
|
<title>Migration to v6.5.3</title>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
A dump/restore is <emphasis>not</emphasis> required for those running
|
A dump/restore is <emphasis>not</emphasis> required for those running
|
||||||
6.5.*.
|
6.5.*.
|
||||||
</para>
|
</para>
|
||||||
</sect2>
|
</sect2>
|
||||||
<sect2>
|
<sect2>
|
||||||
<title>Changes</title>
|
<title>Changes</title>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
<programlisting>
|
<programlisting>
|
||||||
Updated version of pgaccess 0.98
|
Updated version of pgaccess 0.98
|
||||||
NT-specific patch
|
NT-specific patch
|
||||||
Fix dumping rules on inherited tables
|
Fix dumping rules on inherited tables
|
||||||
</programlisting>
|
</programlisting>
|
||||||
</para>
|
</para>
|
||||||
</sect2>
|
</sect2>
|
||||||
</sect1>
|
</sect1>
|
||||||
|
|
||||||
|
|
||||||
<sect1>
|
<sect1>
|
||||||
<title>Release 6.5.2</title>
|
<title>Release 6.5.2</title>
|
||||||
<!--
|
<!--
|
||||||
<docinfo>
|
<docinfo>
|
||||||
<authorgroup>
|
<authorgroup>
|
||||||
<author>
|
<author>
|
||||||
<firstname>Bruce</firstname>
|
<firstname>Bruce</firstname>
|
||||||
<surname>Momjian</surname>
|
<surname>Momjian</surname>
|
||||||
</author>
|
</author>
|
||||||
</authorgroup>
|
</authorgroup>
|
||||||
<date>1999-09-15</date>
|
<date>1999-09-15</date>
|
||||||
</docinfo>
|
</docinfo>
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
1999-09-15
|
Released 1999-09-15.
|
||||||
</para>
|
This is basically a cleanup release for 6.5.1. We have fixed a variety of
|
||||||
<para>
|
problems reported by 6.5.1 users.
|
||||||
This is basically a cleanup release for 6.5.1. We have fixed a variety of
|
</para>
|
||||||
problems reported by 6.5.1 users.
|
|
||||||
</para>
|
|
||||||
|
|
||||||
|
|
||||||
<sect2>
|
<sect2>
|
||||||
<title>Migration to v6.5.2</title>
|
<title>Migration to v6.5.2</title>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
A dump/restore is <emphasis>not</emphasis> required for those running
|
A dump/restore is <emphasis>not</emphasis> required for those running
|
||||||
6.5.*.
|
6.5.*.
|
||||||
</para>
|
</para>
|
||||||
</sect2>
|
</sect2>
|
||||||
<sect2>
|
|
||||||
<title>Changes</title>
|
|
||||||
|
|
||||||
<para>
|
<sect2>
|
||||||
<programlisting>
|
<title>Changes</title>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
<programlisting>
|
||||||
subselect+CASE fixes(Tom)
|
subselect+CASE fixes(Tom)
|
||||||
Add SHLIB_LINK setting for solaris_i386 and solaris_sparc ports(Daren Sefcik)
|
Add SHLIB_LINK setting for solaris_i386 and solaris_sparc ports(Daren Sefcik)
|
||||||
Fixes for CASE in WHERE join clauses(Tom)
|
Fixes for CASE in WHERE join clauses(Tom)
|
||||||
@ -716,48 +708,47 @@ Repair logic error in LIKE: should not return LIKE_ABORT
|
|||||||
when reach end of pattern before end of text(Tom)
|
when reach end of pattern before end of text(Tom)
|
||||||
Repair incorrect cleanup of heap memory allocation during transaction abort(Tom)
|
Repair incorrect cleanup of heap memory allocation during transaction abort(Tom)
|
||||||
Updated version of pgaccess 0.98
|
Updated version of pgaccess 0.98
|
||||||
</programlisting>
|
</programlisting>
|
||||||
</para>
|
</para>
|
||||||
</sect2>
|
</sect2>
|
||||||
</sect1>
|
</sect1>
|
||||||
|
|
||||||
|
<sect1>
|
||||||
|
<title>Release 6.5.1</title>
|
||||||
|
<!--
|
||||||
|
<docinfo>
|
||||||
|
<authorgroup>
|
||||||
|
<author>
|
||||||
|
<firstname>Bruce</firstname>
|
||||||
|
<surname>Momjian</surname>
|
||||||
|
</author>
|
||||||
|
</authorgroup>
|
||||||
|
<date>1999-07-15</date>
|
||||||
|
</docinfo>
|
||||||
|
-->
|
||||||
|
|
||||||
<sect1>
|
<para>
|
||||||
<title>Release 6.5.1</title>
|
Released 1999-07-15.
|
||||||
<!--
|
</para>
|
||||||
<docinfo>
|
<para>
|
||||||
<authorgroup>
|
This is basically a cleanup release for 6.5. We have fixed a variety of
|
||||||
<author>
|
problems reported by 6.5 users.
|
||||||
<firstname>Bruce</firstname>
|
</para>
|
||||||
<surname>Momjian</surname>
|
|
||||||
</author>
|
|
||||||
</authorgroup>
|
|
||||||
<date>1999-07-15</date>
|
|
||||||
</docinfo>
|
|
||||||
-->
|
|
||||||
|
|
||||||
<para>
|
<sect2>
|
||||||
1999-07-15
|
<title>Migration to v6.5.1</title>
|
||||||
</para>
|
|
||||||
<para>
|
|
||||||
This is basically a cleanup release for 6.5. We have fixed a variety of
|
|
||||||
problems reported by 6.5 users.
|
|
||||||
</para>
|
|
||||||
|
|
||||||
|
<para>
|
||||||
|
A dump/restore is <emphasis>not</emphasis> required for those running
|
||||||
|
6.5.
|
||||||
|
</para>
|
||||||
|
</sect2>
|
||||||
|
|
||||||
<sect2>
|
<sect2>
|
||||||
<title>Migration to v6.5.1</title>
|
<title>Changes</title>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
A dump/restore is <emphasis>not</emphasis> required for those running
|
<programlisting>
|
||||||
6.5.
|
|
||||||
</para>
|
|
||||||
</sect2>
|
|
||||||
<sect2>
|
|
||||||
<title>Changes</title>
|
|
||||||
|
|
||||||
<para>
|
|
||||||
<programlisting>
|
|
||||||
Add NT README file
|
Add NT README file
|
||||||
Portability fixes for linux_ppc, Irix, linux_alpha, OpenBSD, alpha
|
Portability fixes for linux_ppc, Irix, linux_alpha, OpenBSD, alpha
|
||||||
Remove QUERY_LIMIT, use SELECT...LIMIT
|
Remove QUERY_LIMIT, use SELECT...LIMIT
|
||||||
@ -781,30 +772,27 @@ Shared library dependencies fixed (Tom)
|
|||||||
Fixed glitches affecting GROUP BY in subselects(Tom)
|
Fixed glitches affecting GROUP BY in subselects(Tom)
|
||||||
Fix some compiler warnings (Tomoaki Nishiyama)
|
Fix some compiler warnings (Tomoaki Nishiyama)
|
||||||
Add Win1250 (Czech) support (Pavel Behal)
|
Add Win1250 (Czech) support (Pavel Behal)
|
||||||
</programlisting>
|
</programlisting>
|
||||||
</para>
|
</para>
|
||||||
</sect2>
|
</sect2>
|
||||||
</sect1>
|
</sect1>
|
||||||
|
|
||||||
|
<sect1>
|
||||||
<sect1>
|
<title>Release 6.5</title>
|
||||||
<title>Release 6.5</title>
|
<!--
|
||||||
<!--
|
<docinfo>
|
||||||
<docinfo>
|
<authorgroup>
|
||||||
<authorgroup>
|
<author>
|
||||||
<author>
|
<firstname>Bruce</firstname>
|
||||||
<firstname>Bruce</firstname>
|
<surname>Momjian</surname>
|
||||||
<surname>Momjian</surname>
|
</author>
|
||||||
</author>
|
</authorgroup>
|
||||||
</authorgroup>
|
<date>1999-06-09</date>
|
||||||
<date>1999-06-09</date>
|
</docinfo>
|
||||||
</docinfo>
|
-->
|
||||||
-->
|
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
1999-06-09
|
Released 1999-06-09.
|
||||||
</para>
|
|
||||||
<para>
|
|
||||||
This release marks a major step in the development team's mastery of the source
|
This release marks a major step in the development team's mastery of the source
|
||||||
code we inherited from Berkeley. You will see we are now easily adding
|
code we inherited from Berkeley. You will see we are now easily adding
|
||||||
major features, thanks to the increasing size and experience of our
|
major features, thanks to the increasing size and experience of our
|
||||||
@ -1023,6 +1011,8 @@ Add Win1250 (Czech) support (Pavel Behal)
|
|||||||
</sect2>
|
</sect2>
|
||||||
|
|
||||||
<sect2>
|
<sect2>
|
||||||
|
<title>Changes</title>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
<programlisting>
|
<programlisting>
|
||||||
Bug Fixes
|
Bug Fixes
|
||||||
@ -1412,10 +1402,12 @@ is required for those wishing to migrate data from any
|
|||||||
previous release of <productname>Postgres</productname>.
|
previous release of <productname>Postgres</productname>.
|
||||||
</para>
|
</para>
|
||||||
</sect2>
|
</sect2>
|
||||||
<sect2>
|
|
||||||
|
|
||||||
<para>
|
<sect2>
|
||||||
<programlisting>
|
<title>Changes</title>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
<programlisting>
|
||||||
Bug Fixes
|
Bug Fixes
|
||||||
---------
|
---------
|
||||||
Fix for a tiny memory leak in PQsetdb/PQfinish(Bryan)
|
Fix for a tiny memory leak in PQsetdb/PQfinish(Bryan)
|
||||||
@ -1664,12 +1656,11 @@ For upgrades from pre-v6.3 installations,
|
|||||||
refer to the installation and migration instructions for v6.3.
|
refer to the installation and migration instructions for v6.3.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<sect2>
|
<sect2>
|
||||||
|
<title>Changes</title>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
<programlisting>
|
<programlisting>
|
||||||
Changes
|
|
||||||
-------
|
|
||||||
Configure detection improvements for tcl/tk(Brook Milligan, Alvin)
|
Configure detection improvements for tcl/tk(Brook Milligan, Alvin)
|
||||||
Manual page improvements(Bruce)
|
Manual page improvements(Bruce)
|
||||||
BETWEEN and LIKE fix(Thomas)
|
BETWEEN and LIKE fix(Thomas)
|
||||||
@ -1688,29 +1679,28 @@ libreadline cleanup(Erwan MAS)
|
|||||||
Remove DISTDIR(Bruce)
|
Remove DISTDIR(Bruce)
|
||||||
Makefile dependency cleanup(Jeroen van Vianen)
|
Makefile dependency cleanup(Jeroen van Vianen)
|
||||||
ASSERT fixes(Bruce)
|
ASSERT fixes(Bruce)
|
||||||
</programlisting>
|
</programlisting>
|
||||||
</para>
|
</para>
|
||||||
</sect2>
|
</sect2>
|
||||||
</sect1>
|
</sect1>
|
||||||
<sect1>
|
|
||||||
<title>Release 6.3.1</title>
|
|
||||||
<!--
|
|
||||||
<docinfo>
|
|
||||||
<authorgroup>
|
|
||||||
<author>
|
|
||||||
<firstname>Bruce</firstname>
|
|
||||||
<surname>Momjian</surname>
|
|
||||||
</author>
|
|
||||||
</authorgroup>
|
|
||||||
<date>1998-03-23</date>
|
|
||||||
</docinfo>
|
|
||||||
-->
|
|
||||||
|
|
||||||
<para>
|
<sect1>
|
||||||
1998-03-23
|
<title>Release 6.3.1</title>
|
||||||
</para>
|
<!--
|
||||||
<para>
|
<docinfo>
|
||||||
Summary:
|
<authorgroup>
|
||||||
|
<author>
|
||||||
|
<firstname>Bruce</firstname>
|
||||||
|
<surname>Momjian</surname>
|
||||||
|
</author>
|
||||||
|
</authorgroup>
|
||||||
|
<date>1998-03-23</date>
|
||||||
|
</docinfo>
|
||||||
|
-->
|
||||||
|
|
||||||
|
<para>
|
||||||
|
Released 1998-03-23.
|
||||||
|
Summary:
|
||||||
|
|
||||||
<itemizedlist>
|
<itemizedlist>
|
||||||
<listitem>
|
<listitem>
|
||||||
@ -1750,12 +1740,11 @@ For upgrades from pre-v6.3 installations,
|
|||||||
refer to the installation and migration instructions for v6.3.
|
refer to the installation and migration instructions for v6.3.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<sect2>
|
<sect2>
|
||||||
|
<title>Changes</title>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
<programlisting>
|
<programlisting>
|
||||||
Changes
|
|
||||||
-------
|
|
||||||
ecpg cleanup/fixes, now version 1.1(Michael Meskes)
|
ecpg cleanup/fixes, now version 1.1(Michael Meskes)
|
||||||
pg_user cleanup(Bruce)
|
pg_user cleanup(Bruce)
|
||||||
large object fix for pg_dump and tclsh (alvin)
|
large object fix for pg_dump and tclsh (alvin)
|
||||||
@ -1783,59 +1772,58 @@ Fix Alpha port(Dwayne Bailey)
|
|||||||
Fix for text arrays containing quotes(Doug Gibson)
|
Fix for text arrays containing quotes(Doug Gibson)
|
||||||
Solaris compile fix(Albert Chin-A-Young)
|
Solaris compile fix(Albert Chin-A-Young)
|
||||||
Better identify tcl and tk libs and includes(Bruce)
|
Better identify tcl and tk libs and includes(Bruce)
|
||||||
</programlisting>
|
</programlisting>
|
||||||
</para>
|
</para>
|
||||||
</sect2>
|
</sect2>
|
||||||
</sect1>
|
</sect1>
|
||||||
<sect1>
|
|
||||||
<title>Release 6.3</title>
|
|
||||||
<!--
|
|
||||||
<docinfo>
|
|
||||||
<authorgroup>
|
|
||||||
<author>
|
|
||||||
<firstname>Bruce</firstname>
|
|
||||||
<surname>Momjian</surname>
|
|
||||||
</author>
|
|
||||||
</authorgroup>
|
|
||||||
<date>1998-03-01</date>
|
|
||||||
</docinfo>
|
|
||||||
-->
|
|
||||||
|
|
||||||
<para>
|
<sect1>
|
||||||
1998-03-01
|
<title>Release 6.3</title>
|
||||||
</para>
|
<!--
|
||||||
<para>
|
<docinfo>
|
||||||
There are <emphasis>many</emphasis> new features and improvements in this release.
|
<authorgroup>
|
||||||
Here is a brief, incomplete summary:
|
<author>
|
||||||
|
<firstname>Bruce</firstname>
|
||||||
|
<surname>Momjian</surname>
|
||||||
|
</author>
|
||||||
|
</authorgroup>
|
||||||
|
<date>1998-03-01</date>
|
||||||
|
</docinfo>
|
||||||
|
-->
|
||||||
|
|
||||||
<itemizedlist>
|
<para>
|
||||||
<listitem>
|
Released 1998-03-01.
|
||||||
<para>
|
There are <emphasis>many</emphasis> new features and improvements in this release.
|
||||||
Many new SQL features, including
|
Here is a brief, incomplete summary:
|
||||||
full <acronym>SQL92</acronym> subselect capability
|
|
||||||
(everything is here but target-list subselects).
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
|
|
||||||
<listitem>
|
<itemizedlist>
|
||||||
<para>
|
<listitem>
|
||||||
Support for client-side environment variables to specify time zone and date style.
|
<para>
|
||||||
</para>
|
Many new SQL features, including
|
||||||
</listitem>
|
full <acronym>SQL92</acronym> subselect capability
|
||||||
|
(everything is here but target-list subselects).
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Socket interface for client/server connection. This is the default now
|
Support for client-side environment variables to specify time zone and date style.
|
||||||
so you may need to start <application>postmaster</application> with the
|
</para>
|
||||||
<option>-i</option> flag.
|
</listitem>
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Better password authorization mechanisms. Default table permissions have changed.
|
Socket interface for client/server connection. This is the default now
|
||||||
</para>
|
so you may need to start <application>postmaster</application> with the
|
||||||
</listitem>
|
<option>-i</option> flag.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
Better password authorization mechanisms. Default table permissions have changed.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
@ -1843,101 +1831,101 @@ Better password authorization mechanisms. Default table permissions have changed
|
|||||||
has been removed. Performance has been improved.
|
has been removed. Performance has been improved.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
</itemizedlist>
|
||||||
|
</para>
|
||||||
|
|
||||||
</itemizedlist>
|
<note>
|
||||||
</para>
|
<para>
|
||||||
|
Bruce Momjian wrote the following notes to introduce the new release.
|
||||||
|
</para>
|
||||||
|
</note>
|
||||||
|
|
||||||
<note>
|
<para>
|
||||||
<para>
|
There are some general 6.3 issues that I want to mention. These are
|
||||||
Bruce Momjian wrote the following notes to introduce the new release.
|
only the big items that can not be described in one sentence. A review
|
||||||
</para>
|
of the detailed changes list is still needed.
|
||||||
</note>
|
</para>
|
||||||
|
<para>
|
||||||
|
First, we now have subselects. Now that we have them, I would like to
|
||||||
|
mention that without subselects, SQL is a very limited language.
|
||||||
|
Subselects are a major feature, and you should review your code for
|
||||||
|
places where subselects provide a better solution for your queries. I
|
||||||
|
think you will find that there are more uses for subselects than you may
|
||||||
|
think. Vadim has put us on the big SQL map with subselects, and fully
|
||||||
|
functional ones too. The only thing you can't do with subselects is to
|
||||||
|
use them in the target list.
|
||||||
|
</para>
|
||||||
|
<para>
|
||||||
|
Second, 6.3 uses unix domain sockets rather than TCP/IP by default. To
|
||||||
|
enable connections from other machines, you have to use the new
|
||||||
|
postmaster -i option, and of course edit pg_hba.conf. Also, for this
|
||||||
|
reason, the format of pg_hba.conf has changed.
|
||||||
|
</para>
|
||||||
|
<para>
|
||||||
|
Third, char() fields will now allow faster access than varchar() or
|
||||||
|
text. Specifically, the text and varchar() have a penalty for access to
|
||||||
|
any columns after the first column of this type. char() used to also
|
||||||
|
have this access penalty, but it no longer does. This may suggest that
|
||||||
|
you redesign some of your tables, especially if you have short character
|
||||||
|
columns that you have defined as varchar() or text. This and other
|
||||||
|
changes make 6.3 even faster than earlier releases.
|
||||||
|
</para>
|
||||||
|
<para>
|
||||||
|
We now have passwords definable independent of any Unix file. There are
|
||||||
|
new SQL USER commands. See the pg_hba.conf manual page for more
|
||||||
|
information. There is a new table, pg_shadow, which is used to store
|
||||||
|
user information and user passwords, and it by default only SELECT-able
|
||||||
|
by the postgres super-user. pg_user is now a view of pg_shadow, and is
|
||||||
|
SELECT-able by PUBLIC. You should keep using pg_user in your
|
||||||
|
application without changes.
|
||||||
|
</para>
|
||||||
|
<para>
|
||||||
|
User-created tables now no longer have SELECT permission to PUBLIC by
|
||||||
|
default. This was done because the ANSI standard requires it. You can
|
||||||
|
of course GRANT any permissions you want after the table is created.
|
||||||
|
System tables continue to be SELECT-able by PUBLIC.
|
||||||
|
</para>
|
||||||
|
<para>
|
||||||
|
We also have real deadlock detection code. No more sixty-second
|
||||||
|
timeouts. And the new locking code implements a FIFO better, so there
|
||||||
|
should be less resource starvation during heavy use.
|
||||||
|
</para>
|
||||||
|
<para>
|
||||||
|
Many complaints have been made about inadequate documenation in previous
|
||||||
|
releases. Thomas has put much effort into many new manuals for this
|
||||||
|
release. Check out the doc/ directory.
|
||||||
|
</para>
|
||||||
|
<para>
|
||||||
|
For performance reasons, time travel is gone, but can be implemented
|
||||||
|
using triggers (see pgsql/contrib/spi/README). Please check out the new
|
||||||
|
\d command for types, operators, etc. Also, views have their own
|
||||||
|
permissions now, not based on the underlying tables, so permissions on
|
||||||
|
them have to be set separately. Check /pgsql/interfaces for some new
|
||||||
|
ways to talk to <productname>Postgres</productname>.
|
||||||
|
</para>
|
||||||
|
<para>
|
||||||
|
This is the first release that really required an explanation for
|
||||||
|
existing users. In many ways, this was necessary because the new
|
||||||
|
release removes many limitations, and the work-arounds people were using
|
||||||
|
are no longer needed.
|
||||||
|
</para>
|
||||||
|
|
||||||
<para>
|
<sect2>
|
||||||
There are some general 6.3 issues that I want to mention. These are
|
<title>Migration to v6.3</title>
|
||||||
only the big items that can not be described in one sentence. A review
|
|
||||||
of the detailed changes list is still needed.
|
|
||||||
</para>
|
|
||||||
<para>
|
|
||||||
First, we now have subselects. Now that we have them, I would like to
|
|
||||||
mention that without subselects, SQL is a very limited language.
|
|
||||||
Subselects are a major feature, and you should review your code for
|
|
||||||
places where subselects provide a better solution for your queries. I
|
|
||||||
think you will find that there are more uses for subselects than you may
|
|
||||||
think. Vadim has put us on the big SQL map with subselects, and fully
|
|
||||||
functional ones too. The only thing you can't do with subselects is to
|
|
||||||
use them in the target list.
|
|
||||||
</para>
|
|
||||||
<para>
|
|
||||||
Second, 6.3 uses unix domain sockets rather than TCP/IP by default. To
|
|
||||||
enable connections from other machines, you have to use the new
|
|
||||||
postmaster -i option, and of course edit pg_hba.conf. Also, for this
|
|
||||||
reason, the format of pg_hba.conf has changed.
|
|
||||||
</para>
|
|
||||||
<para>
|
|
||||||
Third, char() fields will now allow faster access than varchar() or
|
|
||||||
text. Specifically, the text and varchar() have a penalty for access to
|
|
||||||
any columns after the first column of this type. char() used to also
|
|
||||||
have this access penalty, but it no longer does. This may suggest that
|
|
||||||
you redesign some of your tables, especially if you have short character
|
|
||||||
columns that you have defined as varchar() or text. This and other
|
|
||||||
changes make 6.3 even faster than earlier releases.
|
|
||||||
</para>
|
|
||||||
<para>
|
|
||||||
We now have passwords definable independent of any Unix file. There are
|
|
||||||
new SQL USER commands. See the pg_hba.conf manual page for more
|
|
||||||
information. There is a new table, pg_shadow, which is used to store
|
|
||||||
user information and user passwords, and it by default only SELECT-able
|
|
||||||
by the postgres super-user. pg_user is now a view of pg_shadow, and is
|
|
||||||
SELECT-able by PUBLIC. You should keep using pg_user in your
|
|
||||||
application without changes.
|
|
||||||
</para>
|
|
||||||
<para>
|
|
||||||
User-created tables now no longer have SELECT permission to PUBLIC by
|
|
||||||
default. This was done because the ANSI standard requires it. You can
|
|
||||||
of course GRANT any permissions you want after the table is created.
|
|
||||||
System tables continue to be SELECT-able by PUBLIC.
|
|
||||||
</para>
|
|
||||||
<para>
|
|
||||||
We also have real deadlock detection code. No more sixty-second
|
|
||||||
timeouts. And the new locking code implements a FIFO better, so there
|
|
||||||
should be less resource starvation during heavy use.
|
|
||||||
</para>
|
|
||||||
<para>
|
|
||||||
Many complaints have been made about inadequate documenation in previous
|
|
||||||
releases. Thomas has put much effort into many new manuals for this
|
|
||||||
release. Check out the doc/ directory.
|
|
||||||
</para>
|
|
||||||
<para>
|
|
||||||
For performance reasons, time travel is gone, but can be implemented
|
|
||||||
using triggers (see pgsql/contrib/spi/README). Please check out the new
|
|
||||||
\d command for types, operators, etc. Also, views have their own
|
|
||||||
permissions now, not based on the underlying tables, so permissions on
|
|
||||||
them have to be set separately. Check /pgsql/interfaces for some new
|
|
||||||
ways to talk to <productname>Postgres</productname>.
|
|
||||||
</para>
|
|
||||||
<para>
|
|
||||||
This is the first release that really required an explanation for
|
|
||||||
existing users. In many ways, this was necessary because the new
|
|
||||||
release removes many limitations, and the work-arounds people were using
|
|
||||||
are no longer needed.
|
|
||||||
</para>
|
|
||||||
|
|
||||||
<sect2>
|
<para>
|
||||||
<title>Migration to v6.3</title>
|
A dump/restore using <application>pg_dump</application>
|
||||||
|
or <application>pg_dumpall</application>
|
||||||
|
is required for those wishing to migrate data from any
|
||||||
|
previous release of <productname>Postgres</productname>.
|
||||||
|
</para>
|
||||||
|
</sect2>
|
||||||
|
|
||||||
<para>
|
<sect2>
|
||||||
A dump/restore using <application>pg_dump</application>
|
<title>Changes</title>
|
||||||
or <application>pg_dumpall</application>
|
|
||||||
is required for those wishing to migrate data from any
|
|
||||||
previous release of <productname>Postgres</productname>.
|
|
||||||
</para>
|
|
||||||
</sect2>
|
|
||||||
|
|
||||||
<sect2>
|
<para>
|
||||||
|
<programlisting>
|
||||||
<para>
|
|
||||||
<programlisting>
|
|
||||||
Bug Fixes
|
Bug Fixes
|
||||||
---------
|
---------
|
||||||
Fix binary cursors broken by MOVE implementation(Vadim)
|
Fix binary cursors broken by MOVE implementation(Vadim)
|
||||||
@ -2176,12 +2164,12 @@ from psql to update the existing system table:
|
|||||||
This will need to be done to every existing database, including template1.
|
This will need to be done to every existing database, including template1.
|
||||||
</para>
|
</para>
|
||||||
</sect2>
|
</sect2>
|
||||||
<sect2>
|
|
||||||
|
|
||||||
<para>
|
<sect2>
|
||||||
<programlisting>
|
<title>Changes</title>
|
||||||
Changes
|
|
||||||
-------
|
<para>
|
||||||
|
<programlisting>
|
||||||
Allow TIME and TYPE column names(Thomas)
|
Allow TIME and TYPE column names(Thomas)
|
||||||
Allow larger range of true/false as boolean values(Thomas)
|
Allow larger range of true/false as boolean values(Thomas)
|
||||||
Support output of "now" and "current"(Thomas)
|
Support output of "now" and "current"(Thomas)
|
||||||
@ -2193,10 +2181,10 @@ Fix avg(cash) computation(Thomas)
|
|||||||
Fix for specifying a column twice in ORDER/GROUP BY(Vadim)
|
Fix for specifying a column twice in ORDER/GROUP BY(Vadim)
|
||||||
Documented new libpq function to return affected rows, PQcmdTuples(Bruce)
|
Documented new libpq function to return affected rows, PQcmdTuples(Bruce)
|
||||||
Trigger function for inserting user names for INSERT/UPDATE(Brook Milligan)
|
Trigger function for inserting user names for INSERT/UPDATE(Brook Milligan)
|
||||||
</programlisting>
|
</programlisting>
|
||||||
</para>
|
</para>
|
||||||
</sect2>
|
</sect2>
|
||||||
</sect1>
|
</sect1>
|
||||||
|
|
||||||
<sect1>
|
<sect1>
|
||||||
<title>Release 6.2</title>
|
<title>Release 6.2</title>
|
||||||
@ -2243,10 +2231,11 @@ because the COPY output format was improved from the 1.02 release.
|
|||||||
</para>
|
</para>
|
||||||
</sect2>
|
</sect2>
|
||||||
|
|
||||||
<sect2>
|
<sect2>
|
||||||
|
<title>Changes</title>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
<programlisting>
|
<programlisting>
|
||||||
Bug Fixes
|
Bug Fixes
|
||||||
---------
|
---------
|
||||||
Fix problems with pg_dump for inheritance, sequences, archive tables(Bruce)
|
Fix problems with pg_dump for inheritance, sequences, archive tables(Bruce)
|
||||||
@ -2388,12 +2377,11 @@ Refer to the release notes for v6.1 for more details.
|
|||||||
</para>
|
</para>
|
||||||
</sect2>
|
</sect2>
|
||||||
|
|
||||||
<sect2>
|
<sect2>
|
||||||
|
<title>Changes</title>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
<programlisting>
|
<programlisting>
|
||||||
Changes
|
|
||||||
-------
|
|
||||||
fix for SET with options (Thomas)
|
fix for SET with options (Thomas)
|
||||||
allow pg_dump/pg_dumpall to preserve ownership of all tables/objects(Bruce)
|
allow pg_dump/pg_dumpall to preserve ownership of all tables/objects(Bruce)
|
||||||
new psql \connect option allows changing usernames without changing databases
|
new psql \connect option allows changing usernames without changing databases
|
||||||
@ -2411,10 +2399,10 @@ major fix for endian handling of communication to server(Thomas, Tatsuo)
|
|||||||
Fix for Solaris assembler and include files(Yoshihiko Ichikawa)
|
Fix for Solaris assembler and include files(Yoshihiko Ichikawa)
|
||||||
allow underscores in usernames(Bruce)
|
allow underscores in usernames(Bruce)
|
||||||
pg_dumpall now returns proper status, portability fix(Bruce)
|
pg_dumpall now returns proper status, portability fix(Bruce)
|
||||||
</programlisting>
|
</programlisting>
|
||||||
</para>
|
</para>
|
||||||
</sect2>
|
</sect2>
|
||||||
</sect1>
|
</sect1>
|
||||||
|
|
||||||
<sect1>
|
<sect1>
|
||||||
<title>Release 6.1</title>
|
<title>Release 6.1</title>
|
||||||
@ -2492,10 +2480,11 @@ because the COPY output format was improved from the 1.02 release.
|
|||||||
</para>
|
</para>
|
||||||
</sect2>
|
</sect2>
|
||||||
|
|
||||||
<sect2>
|
<sect2>
|
||||||
|
<title>Changes</title>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
<programlisting>
|
<programlisting>
|
||||||
Bug Fixes
|
Bug Fixes
|
||||||
---------
|
---------
|
||||||
packet length checking in library routines
|
packet length checking in library routines
|
||||||
@ -2635,10 +2624,11 @@ because the COPY output format was improved from the 1.02 release.
|
|||||||
</para>
|
</para>
|
||||||
</sect2>
|
</sect2>
|
||||||
|
|
||||||
<sect2>
|
<sect2>
|
||||||
|
<title>Changes</title>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
<programlisting>
|
<programlisting>
|
||||||
Bug Fixes
|
Bug Fixes
|
||||||
---------
|
---------
|
||||||
ALTER TABLE bug - running postgress process needs to re-read table definition
|
ALTER TABLE bug - running postgress process needs to re-read table definition
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<!--
|
<!--
|
||||||
$Header: /cvsroot/pgsql/doc/src/sgml/sql.sgml,v 1.9 2000/05/02 20:01:52 thomas Exp $
|
$Header: /cvsroot/pgsql/doc/src/sgml/sql.sgml,v 1.9.2.1 2000/06/14 13:18:59 thomas Exp $
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<chapter id="sql">
|
<chapter id="sql">
|
||||||
@ -155,16 +155,18 @@ $Header: /cvsroot/pgsql/doc/src/sgml/sql.sgml,v 1.9 2000/05/02 20:01:52 thomas E
|
|||||||
<example>
|
<example>
|
||||||
<title id="supplier-fig">The Suppliers and Parts Database</title>
|
<title id="supplier-fig">The Suppliers and Parts Database</title>
|
||||||
<programlisting>
|
<programlisting>
|
||||||
SUPPLIER SNO | SNAME | CITY SELLS SNO | PNO
|
SUPPLIER: SELLS:
|
||||||
-----+---------+-------- -----+-----
|
SNO | SNAME | CITY SNO | PNO
|
||||||
|
----+---------+-------- -----+-----
|
||||||
1 | Smith | London 1 | 1
|
1 | Smith | London 1 | 1
|
||||||
2 | Jones | Paris 1 | 2
|
2 | Jones | Paris 1 | 2
|
||||||
3 | Adams | Vienna 2 | 4
|
3 | Adams | Vienna 2 | 4
|
||||||
4 | Blake | Rome 3 | 1
|
4 | Blake | Rome 3 | 1
|
||||||
3 | 3
|
3 | 3
|
||||||
4 | 2
|
4 | 2
|
||||||
PART PNO | PNAME | PRICE 4 | 3
|
PART: 4 | 3
|
||||||
-----+---------+--------- 4 | 4
|
PNO | PNAME | PRICE 4 | 4
|
||||||
|
----+---------+---------
|
||||||
1 | Screw | 10
|
1 | Screw | 10
|
||||||
2 | Nut | 8
|
2 | Nut | 8
|
||||||
3 | Bolt | 15
|
3 | Bolt | 15
|
||||||
@ -474,7 +476,7 @@ attributes are taken from. We often write a relation scheme as
|
|||||||
INTERSECT (∩): builds the set-theoretic intersection of two
|
INTERSECT (∩): builds the set-theoretic intersection of two
|
||||||
tables. Given the tables <classname>R</classname> and
|
tables. Given the tables <classname>R</classname> and
|
||||||
<classname>S</classname>,
|
<classname>S</classname>,
|
||||||
<classname>R</classname> ∪ <classname>S</classname> is the
|
<classname>R</classname> ∩ <classname>S</classname> is the
|
||||||
set of tuples
|
set of tuples
|
||||||
that are in <classname>R</classname> and in
|
that are in <classname>R</classname> and in
|
||||||
<classname>S</classname>.
|
<classname>S</classname>.
|
||||||
@ -532,8 +534,9 @@ attributes are taken from. We often write a relation scheme as
|
|||||||
Let the following two tables be given:
|
Let the following two tables be given:
|
||||||
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
R A | B | C S C | D | E
|
R: S:
|
||||||
---+---+--- ---+---+---
|
A | B | C C | D | E
|
||||||
|
---+---+--- ---+---+---
|
||||||
1 | 2 | 3 3 | a | b
|
1 | 2 | 3 3 | a | b
|
||||||
4 | 5 | 6 6 | c | d
|
4 | 5 | 6 6 | c | d
|
||||||
7 | 8 | 9
|
7 | 8 | 9
|
||||||
@ -547,8 +550,9 @@ attributes are taken from. We often write a relation scheme as
|
|||||||
get:
|
get:
|
||||||
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
R x S A | B | R.C | S.C | D | E
|
R x S:
|
||||||
---+---+-----+-----+---+---
|
A | B | R.C | S.C | D | E
|
||||||
|
---+---+-----+-----+---+---
|
||||||
1 | 2 | 3 | 3 | a | b
|
1 | 2 | 3 | 3 | a | b
|
||||||
1 | 2 | 3 | 6 | c | d
|
1 | 2 | 3 | 6 | c | d
|
||||||
4 | 5 | 6 | 3 | a | b
|
4 | 5 | 6 | 3 | a | b
|
||||||
@ -565,7 +569,7 @@ attributes are taken from. We often write a relation scheme as
|
|||||||
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
A | B | R.C | S.C | D | E
|
A | B | R.C | S.C | D | E
|
||||||
---+---+-----+-----+---+---
|
---+---+-----+-----+---+---
|
||||||
1 | 2 | 3 | 3 | a | b
|
1 | 2 | 3 | 3 | a | b
|
||||||
4 | 5 | 6 | 6 | c | d
|
4 | 5 | 6 | 6 | c | d
|
||||||
</programlisting>
|
</programlisting>
|
||||||
@ -580,7 +584,7 @@ attributes are taken from. We often write a relation scheme as
|
|||||||
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
A | B | C | D | E
|
A | B | C | D | E
|
||||||
---+---+---+---+---
|
---+---+---+---+---
|
||||||
1 | 2 | 3 | a | b
|
1 | 2 | 3 | a | b
|
||||||
4 | 5 | 6 | c | d
|
4 | 5 | 6 | c | d
|
||||||
</programlisting>
|
</programlisting>
|
||||||
@ -595,8 +599,9 @@ attributes are taken from. We often write a relation scheme as
|
|||||||
C and D.
|
C and D.
|
||||||
Then we define the division as:
|
Then we define the division as:
|
||||||
|
|
||||||
R ÷ S = {t ∣ ∀ t<subscript>s</subscript> ∈ S
|
<programlisting>
|
||||||
∃ t<subscript>r</subscript> ∈ R
|
R ÷ S = {t ∣ ∀ t<subscript>s</subscript> ∈ S ∃ t<subscript>r</subscript> ∈ R
|
||||||
|
</programlisting>
|
||||||
|
|
||||||
such that
|
such that
|
||||||
t<subscript>r</subscript>(A,B)=t∧t<subscript>r</subscript>(C,D)=t<subscript>s</subscript>}
|
t<subscript>r</subscript>(A,B)=t∧t<subscript>r</subscript>(C,D)=t<subscript>s</subscript>}
|
||||||
@ -614,8 +619,9 @@ t<subscript>r</subscript>(A,B)=t∧t<subscript>r</subscript>(C,D)=t<subscript>
|
|||||||
Given the following tables
|
Given the following tables
|
||||||
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
R A | B | C | D S C | D
|
R: S:
|
||||||
---+---+---+--- ---+---
|
A | B | C | D C | D
|
||||||
|
---+---+---+--- ---+---
|
||||||
a | b | c | d c | d
|
a | b | c | d c | d
|
||||||
a | b | e | f e | f
|
a | b | e | f e | f
|
||||||
b | c | e | f
|
b | c | e | f
|
||||||
@ -629,7 +635,7 @@ t<subscript>r</subscript>(A,B)=t∧t<subscript>r</subscript>(C,D)=t<subscript>
|
|||||||
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
A | B
|
A | B
|
||||||
---+---
|
---+---
|
||||||
a | b
|
a | b
|
||||||
e | d
|
e | d
|
||||||
</programlisting>
|
</programlisting>
|
||||||
@ -669,7 +675,7 @@ t<subscript>r</subscript>(A,B)=t∧t<subscript>r</subscript>(C,D)=t<subscript>
|
|||||||
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
SNAME
|
SNAME
|
||||||
-------
|
-------
|
||||||
Smith
|
Smith
|
||||||
Adams
|
Adams
|
||||||
</programlisting>
|
</programlisting>
|
||||||
@ -720,7 +726,10 @@ t<subscript>r</subscript>(A,B)=t∧t<subscript>r</subscript>(C,D)=t<subscript>
|
|||||||
<para>
|
<para>
|
||||||
The queries used in <acronym>TRC</acronym> are of the following
|
The queries used in <acronym>TRC</acronym> are of the following
|
||||||
form:
|
form:
|
||||||
x(A) ∣ F(x)
|
|
||||||
|
<programlisting>
|
||||||
|
x(A) ∣ F(x)
|
||||||
|
</programlisting>
|
||||||
|
|
||||||
where <literal>x</literal> is a tuple variable
|
where <literal>x</literal> is a tuple variable
|
||||||
<classname>A</classname> is a set of attributes and <literal>F</literal> is a
|
<classname>A</classname> is a set of attributes and <literal>F</literal> is a
|
||||||
@ -733,11 +742,11 @@ t<subscript>r</subscript>(A,B)=t∧t<subscript>r</subscript>(C,D)=t<subscript>
|
|||||||
<xref linkend="suppl-rel-alg" endterm="suppl-rel-alg">
|
<xref linkend="suppl-rel-alg" endterm="suppl-rel-alg">
|
||||||
using <acronym>TRC</acronym> we formulate the following query:
|
using <acronym>TRC</acronym> we formulate the following query:
|
||||||
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
{x(SNAME) ∣ x ∈ SUPPLIER ∧ \nonumber
|
{x(SNAME) ∣ x ∈ SUPPLIER ∧
|
||||||
∃ y ∈ SELLS ∃ z ∈ PART (y(SNO)=x(SNO) ∧ \nonumber
|
∃ y ∈ SELLS ∃ z ∈ PART (y(SNO)=x(SNO) ∧
|
||||||
z(PNO)=y(PNO) ∧ \nonumber
|
z(PNO)=y(PNO) ∧
|
||||||
z(PNAME)='Screw')} \nonumber
|
z(PNAME)='Screw')}
|
||||||
</programlisting>
|
</programlisting>
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
@ -806,7 +815,9 @@ t<subscript>r</subscript>(A,B)=t∧t<subscript>r</subscript>(C,D)=t<subscript>
|
|||||||
to involve
|
to involve
|
||||||
arithmetic operations as well as comparisons, e.g.
|
arithmetic operations as well as comparisons, e.g.
|
||||||
|
|
||||||
A < B + 3.
|
<programlisting>
|
||||||
|
A < B + 3.
|
||||||
|
</programlisting>
|
||||||
|
|
||||||
Note
|
Note
|
||||||
that + or other arithmetic operators appear neither in relational
|
that + or other arithmetic operators appear neither in relational
|
||||||
@ -843,7 +854,7 @@ t<subscript>r</subscript>(A,B)=t∧t<subscript>r</subscript>(C,D)=t<subscript>
|
|||||||
used to retrieve data. The syntax is:
|
used to retrieve data. The syntax is:
|
||||||
|
|
||||||
<synopsis>
|
<synopsis>
|
||||||
SELECT [ALL|DISTINCT]
|
SELECT [ALL|DISTINCT]
|
||||||
{ * | <replaceable class="parameter">expr_1</replaceable> [AS <replaceable class="parameter">c_alias_1</replaceable>] [, ...
|
{ * | <replaceable class="parameter">expr_1</replaceable> [AS <replaceable class="parameter">c_alias_1</replaceable>] [, ...
|
||||||
[, <replaceable class="parameter">expr_k</replaceable> [AS <replaceable class="parameter">c_alias_k</replaceable>]]]}
|
[, <replaceable class="parameter">expr_k</replaceable> [AS <replaceable class="parameter">c_alias_k</replaceable>]]]}
|
||||||
FROM <replaceable class="parameter">table_name_1</replaceable> [<replaceable class="parameter">t_alias_1</replaceable>]
|
FROM <replaceable class="parameter">table_name_1</replaceable> [<replaceable class="parameter">t_alias_1</replaceable>]
|
||||||
@ -876,7 +887,7 @@ t<subscript>r</subscript>(A,B)=t∧t<subscript>r</subscript>(C,D)=t<subscript>
|
|||||||
greater than 10 we formulate the following query:
|
greater than 10 we formulate the following query:
|
||||||
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
SELECT * FROM PART
|
SELECT * FROM PART
|
||||||
WHERE PRICE > 10;
|
WHERE PRICE > 10;
|
||||||
</programlisting>
|
</programlisting>
|
||||||
|
|
||||||
@ -884,7 +895,7 @@ t<subscript>r</subscript>(A,B)=t∧t<subscript>r</subscript>(C,D)=t<subscript>
|
|||||||
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
PNO | PNAME | PRICE
|
PNO | PNAME | PRICE
|
||||||
-----+---------+--------
|
-----+---------+--------
|
||||||
3 | Bolt | 15
|
3 | Bolt | 15
|
||||||
4 | Cam | 25
|
4 | Cam | 25
|
||||||
</programlisting>
|
</programlisting>
|
||||||
@ -896,7 +907,7 @@ t<subscript>r</subscript>(A,B)=t∧t<subscript>r</subscript>(C,D)=t<subscript>
|
|||||||
from table PART we use the statement:
|
from table PART we use the statement:
|
||||||
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
SELECT PNAME, PRICE
|
SELECT PNAME, PRICE
|
||||||
FROM PART
|
FROM PART
|
||||||
WHERE PRICE > 10;
|
WHERE PRICE > 10;
|
||||||
</programlisting>
|
</programlisting>
|
||||||
@ -920,7 +931,7 @@ t<subscript>r</subscript>(A,B)=t∧t<subscript>r</subscript>(C,D)=t<subscript>
|
|||||||
using the keywords OR, AND, and NOT:
|
using the keywords OR, AND, and NOT:
|
||||||
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
SELECT PNAME, PRICE
|
SELECT PNAME, PRICE
|
||||||
FROM PART
|
FROM PART
|
||||||
WHERE PNAME = 'Bolt' AND
|
WHERE PNAME = 'Bolt' AND
|
||||||
(PRICE = 0 OR PRICE < 15);
|
(PRICE = 0 OR PRICE < 15);
|
||||||
@ -930,7 +941,7 @@ t<subscript>r</subscript>(A,B)=t∧t<subscript>r</subscript>(C,D)=t<subscript>
|
|||||||
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
PNAME | PRICE
|
PNAME | PRICE
|
||||||
--------+--------
|
--------+--------
|
||||||
Bolt | 15
|
Bolt | 15
|
||||||
</programlisting>
|
</programlisting>
|
||||||
</para>
|
</para>
|
||||||
@ -941,7 +952,7 @@ t<subscript>r</subscript>(A,B)=t∧t<subscript>r</subscript>(C,D)=t<subscript>
|
|||||||
take two pieces of a part we could use the following query:
|
take two pieces of a part we could use the following query:
|
||||||
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
SELECT PNAME, PRICE * 2 AS DOUBLE
|
SELECT PNAME, PRICE * 2 AS DOUBLE
|
||||||
FROM PART
|
FROM PART
|
||||||
WHERE PRICE * 2 < 50;
|
WHERE PRICE * 2 < 50;
|
||||||
</programlisting>
|
</programlisting>
|
||||||
@ -950,7 +961,7 @@ t<subscript>r</subscript>(A,B)=t∧t<subscript>r</subscript>(C,D)=t<subscript>
|
|||||||
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
PNAME | DOUBLE
|
PNAME | DOUBLE
|
||||||
--------+---------
|
--------+---------
|
||||||
Screw | 20
|
Screw | 20
|
||||||
Nut | 16
|
Nut | 16
|
||||||
Bolt | 30
|
Bolt | 30
|
||||||
@ -980,7 +991,7 @@ t<subscript>r</subscript>(A,B)=t∧t<subscript>r</subscript>(C,D)=t<subscript>
|
|||||||
attributes we formulate the following statement:
|
attributes we formulate the following statement:
|
||||||
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
SELECT S.SNAME, P.PNAME
|
SELECT S.SNAME, P.PNAME
|
||||||
FROM SUPPLIER S, PART P, SELLS SE
|
FROM SUPPLIER S, PART P, SELLS SE
|
||||||
WHERE S.SNO = SE.SNO AND
|
WHERE S.SNO = SE.SNO AND
|
||||||
P.PNO = SE.PNO;
|
P.PNO = SE.PNO;
|
||||||
@ -990,7 +1001,7 @@ t<subscript>r</subscript>(A,B)=t∧t<subscript>r</subscript>(C,D)=t<subscript>
|
|||||||
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
SNAME | PNAME
|
SNAME | PNAME
|
||||||
-------+-------
|
-------+-------
|
||||||
Smith | Screw
|
Smith | Screw
|
||||||
Smith | Nut
|
Smith | Nut
|
||||||
Jones | Cam
|
Jones | Cam
|
||||||
@ -1040,7 +1051,7 @@ t<subscript>r</subscript>(A,B)=t∧t<subscript>r</subscript>(C,D)=t<subscript>
|
|||||||
the following query:
|
the following query:
|
||||||
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
SELECT AVG(PRICE) AS AVG_PRICE
|
SELECT AVG(PRICE) AS AVG_PRICE
|
||||||
FROM PART;
|
FROM PART;
|
||||||
</programlisting>
|
</programlisting>
|
||||||
</para>
|
</para>
|
||||||
@ -1050,7 +1061,7 @@ t<subscript>r</subscript>(A,B)=t∧t<subscript>r</subscript>(C,D)=t<subscript>
|
|||||||
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
AVG_PRICE
|
AVG_PRICE
|
||||||
-----------
|
-----------
|
||||||
14.5
|
14.5
|
||||||
</programlisting>
|
</programlisting>
|
||||||
</para>
|
</para>
|
||||||
@ -1060,7 +1071,7 @@ t<subscript>r</subscript>(A,B)=t∧t<subscript>r</subscript>(C,D)=t<subscript>
|
|||||||
the statement:
|
the statement:
|
||||||
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
SELECT COUNT(PNO)
|
SELECT COUNT(PNO)
|
||||||
FROM PART;
|
FROM PART;
|
||||||
</programlisting>
|
</programlisting>
|
||||||
|
|
||||||
@ -1068,7 +1079,7 @@ t<subscript>r</subscript>(A,B)=t∧t<subscript>r</subscript>(C,D)=t<subscript>
|
|||||||
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
COUNT
|
COUNT
|
||||||
-------
|
-------
|
||||||
4
|
4
|
||||||
</programlisting>
|
</programlisting>
|
||||||
|
|
||||||
@ -1108,7 +1119,7 @@ t<subscript>r</subscript>(A,B)=t∧t<subscript>r</subscript>(C,D)=t<subscript>
|
|||||||
formulate the query:
|
formulate the query:
|
||||||
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
SELECT S.SNO, S.SNAME, COUNT(SE.PNO)
|
SELECT S.SNO, S.SNAME, COUNT(SE.PNO)
|
||||||
FROM SUPPLIER S, SELLS SE
|
FROM SUPPLIER S, SELLS SE
|
||||||
WHERE S.SNO = SE.SNO
|
WHERE S.SNO = SE.SNO
|
||||||
GROUP BY S.SNO, S.SNAME;
|
GROUP BY S.SNO, S.SNAME;
|
||||||
@ -1118,7 +1129,7 @@ t<subscript>r</subscript>(A,B)=t∧t<subscript>r</subscript>(C,D)=t<subscript>
|
|||||||
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
SNO | SNAME | COUNT
|
SNO | SNAME | COUNT
|
||||||
-----+-------+-------
|
-----+-------+-------
|
||||||
1 | Smith | 2
|
1 | Smith | 2
|
||||||
2 | Jones | 1
|
2 | Jones | 1
|
||||||
3 | Adams | 2
|
3 | Adams | 2
|
||||||
@ -1133,7 +1144,7 @@ t<subscript>r</subscript>(A,B)=t∧t<subscript>r</subscript>(C,D)=t<subscript>
|
|||||||
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
S.SNO | S.SNAME | SE.PNO
|
S.SNO | S.SNAME | SE.PNO
|
||||||
-------+---------+--------
|
-------+---------+--------
|
||||||
1 | Smith | 1
|
1 | Smith | 1
|
||||||
1 | Smith | 2
|
1 | Smith | 2
|
||||||
2 | Jones | 4
|
2 | Jones | 4
|
||||||
@ -1151,15 +1162,15 @@ t<subscript>r</subscript>(A,B)=t∧t<subscript>r</subscript>(C,D)=t<subscript>
|
|||||||
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
S.SNO | S.SNAME | SE.PNO
|
S.SNO | S.SNAME | SE.PNO
|
||||||
-------+---------+--------
|
-------+---------+--------
|
||||||
1 | Smith | 1
|
1 | Smith | 1
|
||||||
| 2
|
| 2
|
||||||
--------------------------
|
--------------------------
|
||||||
2 | Jones | 4
|
2 | Jones | 4
|
||||||
--------------------------
|
--------------------------
|
||||||
3 | Adams | 1
|
3 | Adams | 1
|
||||||
| 3
|
| 3
|
||||||
--------------------------
|
--------------------------
|
||||||
4 | Blake | 2
|
4 | Blake | 2
|
||||||
| 3
|
| 3
|
||||||
| 4
|
| 4
|
||||||
@ -1204,7 +1215,7 @@ t<subscript>r</subscript>(A,B)=t∧t<subscript>r</subscript>(C,D)=t<subscript>
|
|||||||
query:
|
query:
|
||||||
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
SELECT S.SNO, S.SNAME, COUNT(SE.PNO)
|
SELECT S.SNO, S.SNAME, COUNT(SE.PNO)
|
||||||
FROM SUPPLIER S, SELLS SE
|
FROM SUPPLIER S, SELLS SE
|
||||||
WHERE S.SNO = SE.SNO
|
WHERE S.SNO = SE.SNO
|
||||||
GROUP BY S.SNO, S.SNAME
|
GROUP BY S.SNO, S.SNAME
|
||||||
@ -1215,7 +1226,7 @@ t<subscript>r</subscript>(A,B)=t∧t<subscript>r</subscript>(C,D)=t<subscript>
|
|||||||
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
SNO | SNAME | COUNT
|
SNO | SNAME | COUNT
|
||||||
-----+-------+-------
|
-----+-------+-------
|
||||||
1 | Smith | 2
|
1 | Smith | 2
|
||||||
3 | Adams | 2
|
3 | Adams | 2
|
||||||
4 | Blake | 3
|
4 | Blake | 3
|
||||||
@ -1243,7 +1254,7 @@ t<subscript>r</subscript>(A,B)=t∧t<subscript>r</subscript>(C,D)=t<subscript>
|
|||||||
named 'Screw' we use the query:
|
named 'Screw' we use the query:
|
||||||
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
SELECT *
|
SELECT *
|
||||||
FROM PART
|
FROM PART
|
||||||
WHERE PRICE > (SELECT PRICE FROM PART
|
WHERE PRICE > (SELECT PRICE FROM PART
|
||||||
WHERE PNAME='Screw');
|
WHERE PNAME='Screw');
|
||||||
@ -1255,7 +1266,7 @@ t<subscript>r</subscript>(A,B)=t∧t<subscript>r</subscript>(C,D)=t<subscript>
|
|||||||
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
PNO | PNAME | PRICE
|
PNO | PNAME | PRICE
|
||||||
-----+---------+--------
|
-----+---------+--------
|
||||||
3 | Bolt | 15
|
3 | Bolt | 15
|
||||||
4 | Cam | 25
|
4 | Cam | 25
|
||||||
</programlisting>
|
</programlisting>
|
||||||
@ -1272,12 +1283,12 @@ t<subscript>r</subscript>(A,B)=t∧t<subscript>r</subscript>(C,D)=t<subscript>
|
|||||||
greater.
|
greater.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
If we want to know all suppliers that do not sell any part
|
If we want to know all suppliers that do not sell any part
|
||||||
(e.g. to be able to remove these suppliers from the database) we use:
|
(e.g. to be able to remove these suppliers from the database) we use:
|
||||||
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
SELECT *
|
SELECT *
|
||||||
FROM SUPPLIER S
|
FROM SUPPLIER S
|
||||||
WHERE NOT EXISTS
|
WHERE NOT EXISTS
|
||||||
(SELECT * FROM SELLS SE
|
(SELECT * FROM SELLS SE
|
||||||
@ -1310,7 +1321,7 @@ t<subscript>r</subscript>(A,B)=t∧t<subscript>r</subscript>(C,D)=t<subscript>
|
|||||||
The following query is an example for UNION:
|
The following query is an example for UNION:
|
||||||
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
SELECT S.SNO, S.SNAME, S.CITY
|
SELECT S.SNO, S.SNAME, S.CITY
|
||||||
FROM SUPPLIER S
|
FROM SUPPLIER S
|
||||||
WHERE S.SNAME = 'Jones'
|
WHERE S.SNAME = 'Jones'
|
||||||
UNION
|
UNION
|
||||||
@ -1323,7 +1334,7 @@ gives the result:
|
|||||||
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
SNO | SNAME | CITY
|
SNO | SNAME | CITY
|
||||||
-----+-------+--------
|
-----+-------+--------
|
||||||
2 | Jones | Paris
|
2 | Jones | Paris
|
||||||
3 | Adams | Vienna
|
3 | Adams | Vienna
|
||||||
</programlisting>
|
</programlisting>
|
||||||
@ -1333,7 +1344,7 @@ gives the result:
|
|||||||
Here an example for INTERSECT:
|
Here an example for INTERSECT:
|
||||||
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
SELECT S.SNO, S.SNAME, S.CITY
|
SELECT S.SNO, S.SNAME, S.CITY
|
||||||
FROM SUPPLIER S
|
FROM SUPPLIER S
|
||||||
WHERE S.SNO > 1
|
WHERE S.SNO > 1
|
||||||
INTERSECT
|
INTERSECT
|
||||||
@ -1346,17 +1357,18 @@ gives the result:
|
|||||||
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
SNO | SNAME | CITY
|
SNO | SNAME | CITY
|
||||||
-----+-------+--------
|
-----+-------+--------
|
||||||
2 | Jones | Paris
|
2 | Jones | Paris
|
||||||
The only tuple returned by both parts of the query is the one having $SNO=2$.
|
|
||||||
</programlisting>
|
</programlisting>
|
||||||
|
|
||||||
|
The only tuple returned by both parts of the query is the one having $SNO=2$.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
Finally an example for EXCEPT:
|
Finally an example for EXCEPT:
|
||||||
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
SELECT S.SNO, S.SNAME, S.CITY
|
SELECT S.SNO, S.SNAME, S.CITY
|
||||||
FROM SUPPLIER S
|
FROM SUPPLIER S
|
||||||
WHERE S.SNO > 1
|
WHERE S.SNO > 1
|
||||||
EXCEPT
|
EXCEPT
|
||||||
@ -1369,7 +1381,7 @@ The only tuple returned by both parts of the query is the one having $SNO=2$.
|
|||||||
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
SNO | SNAME | CITY
|
SNO | SNAME | CITY
|
||||||
-----+-------+--------
|
-----+-------+--------
|
||||||
2 | Jones | Paris
|
2 | Jones | Paris
|
||||||
3 | Adams | Vienna
|
3 | Adams | Vienna
|
||||||
</programlisting>
|
</programlisting>
|
||||||
@ -1396,7 +1408,7 @@ The only tuple returned by both parts of the query is the one having $SNO=2$.
|
|||||||
CREATE TABLE command is:
|
CREATE TABLE command is:
|
||||||
|
|
||||||
<synopsis>
|
<synopsis>
|
||||||
CREATE TABLE <replaceable class="parameter">table_name</replaceable>
|
CREATE TABLE <replaceable class="parameter">table_name</replaceable>
|
||||||
(<replaceable class="parameter">name_of_attr_1</replaceable> <replaceable class="parameter">type_of_attr_1</replaceable>
|
(<replaceable class="parameter">name_of_attr_1</replaceable> <replaceable class="parameter">type_of_attr_1</replaceable>
|
||||||
[, <replaceable class="parameter">name_of_attr_2</replaceable> <replaceable class="parameter">type_of_attr_2</replaceable>
|
[, <replaceable class="parameter">name_of_attr_2</replaceable> <replaceable class="parameter">type_of_attr_2</replaceable>
|
||||||
[, ...]]);
|
[, ...]]);
|
||||||
@ -1411,21 +1423,21 @@ The only tuple returned by both parts of the query is the one having $SNO=2$.
|
|||||||
following <acronym>SQL</acronym> statements are used:
|
following <acronym>SQL</acronym> statements are used:
|
||||||
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
CREATE TABLE SUPPLIER
|
CREATE TABLE SUPPLIER
|
||||||
(SNO INTEGER,
|
(SNO INTEGER,
|
||||||
SNAME VARCHAR(20),
|
SNAME VARCHAR(20),
|
||||||
CITY VARCHAR(20));
|
CITY VARCHAR(20));
|
||||||
</programlisting>
|
</programlisting>
|
||||||
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
CREATE TABLE PART
|
CREATE TABLE PART
|
||||||
(PNO INTEGER,
|
(PNO INTEGER,
|
||||||
PNAME VARCHAR(20),
|
PNAME VARCHAR(20),
|
||||||
PRICE DECIMAL(4 , 2));
|
PRICE DECIMAL(4 , 2));
|
||||||
</programlisting>
|
</programlisting>
|
||||||
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
CREATE TABLE SELLS
|
CREATE TABLE SELLS
|
||||||
(SNO INTEGER,
|
(SNO INTEGER,
|
||||||
PNO INTEGER);
|
PNO INTEGER);
|
||||||
</programlisting>
|
</programlisting>
|
||||||
@ -1463,7 +1475,7 @@ The only tuple returned by both parts of the query is the one having $SNO=2$.
|
|||||||
<replaceable class="parameter">q</replaceable>
|
<replaceable class="parameter">q</replaceable>
|
||||||
of them right to the decimal point.
|
of them right to the decimal point.
|
||||||
|
|
||||||
(15 ≥ <replaceable class="parameter">p</replaceable> ≥ <replaceable class="parameter">q</replaceable>q ≥ 0).
|
(15 ≥ <replaceable class="parameter">p</replaceable> ≥ <replaceable class="parameter">q</replaceable> ≥ 0).
|
||||||
|
|
||||||
If <replaceable class="parameter">q</replaceable>
|
If <replaceable class="parameter">q</replaceable>
|
||||||
is omitted it is assumed to be 0.
|
is omitted it is assumed to be 0.
|
||||||
@ -1514,7 +1526,7 @@ The only tuple returned by both parts of the query is the one having $SNO=2$.
|
|||||||
the CREATE INDEX command is used. The syntax is:
|
the CREATE INDEX command is used. The syntax is:
|
||||||
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
CREATE INDEX <replaceable class="parameter">index_name</replaceable>
|
CREATE INDEX <replaceable class="parameter">index_name</replaceable>
|
||||||
ON <replaceable class="parameter">table_name</replaceable> ( <replaceable class="parameter">name_of_attribute</replaceable> );
|
ON <replaceable class="parameter">table_name</replaceable> ( <replaceable class="parameter">name_of_attribute</replaceable> );
|
||||||
</programlisting>
|
</programlisting>
|
||||||
</para>
|
</para>
|
||||||
@ -1528,8 +1540,7 @@ The only tuple returned by both parts of the query is the one having $SNO=2$.
|
|||||||
we use the following statement:
|
we use the following statement:
|
||||||
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
CREATE INDEX I
|
CREATE INDEX I ON SUPPLIER (SNAME);
|
||||||
ON SUPPLIER (SNAME);
|
|
||||||
</programlisting>
|
</programlisting>
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
@ -1578,7 +1589,7 @@ The only tuple returned by both parts of the query is the one having $SNO=2$.
|
|||||||
is:
|
is:
|
||||||
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
CREATE VIEW <replaceable class="parameter">view_name</replaceable>
|
CREATE VIEW <replaceable class="parameter">view_name</replaceable>
|
||||||
AS <replaceable class="parameter">select_stmt</replaceable>
|
AS <replaceable class="parameter">select_stmt</replaceable>
|
||||||
</programlisting>
|
</programlisting>
|
||||||
|
|
||||||
@ -1597,7 +1608,7 @@ The only tuple returned by both parts of the query is the one having $SNO=2$.
|
|||||||
<xref linkend="supplier-fig" endterm="supplier-fig"> again):
|
<xref linkend="supplier-fig" endterm="supplier-fig"> again):
|
||||||
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
CREATE VIEW London_Suppliers
|
CREATE VIEW London_Suppliers
|
||||||
AS SELECT S.SNAME, P.PNAME
|
AS SELECT S.SNAME, P.PNAME
|
||||||
FROM SUPPLIER S, PART P, SELLS SE
|
FROM SUPPLIER S, PART P, SELLS SE
|
||||||
WHERE S.SNO = SE.SNO AND
|
WHERE S.SNO = SE.SNO AND
|
||||||
@ -1612,8 +1623,7 @@ The only tuple returned by both parts of the query is the one having $SNO=2$.
|
|||||||
if it were another base table:
|
if it were another base table:
|
||||||
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
SELECT *
|
SELECT * FROM London_Suppliers
|
||||||
FROM London_Suppliers
|
|
||||||
WHERE P.PNAME = 'Screw';
|
WHERE P.PNAME = 'Screw';
|
||||||
</programlisting>
|
</programlisting>
|
||||||
|
|
||||||
@ -1621,7 +1631,7 @@ The only tuple returned by both parts of the query is the one having $SNO=2$.
|
|||||||
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
SNAME | PNAME
|
SNAME | PNAME
|
||||||
-------+-------
|
-------+-------
|
||||||
Smith | Screw
|
Smith | Screw
|
||||||
</programlisting>
|
</programlisting>
|
||||||
</para>
|
</para>
|
||||||
@ -1646,7 +1656,7 @@ The only tuple returned by both parts of the query is the one having $SNO=2$.
|
|||||||
DROP TABLE command is used:
|
DROP TABLE command is used:
|
||||||
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
DROP TABLE <replaceable class="parameter">table_name</replaceable>;
|
DROP TABLE <replaceable class="parameter">table_name</replaceable>;
|
||||||
</programlisting>
|
</programlisting>
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
@ -1654,7 +1664,7 @@ The only tuple returned by both parts of the query is the one having $SNO=2$.
|
|||||||
To destroy the SUPPLIER table use the following statement:
|
To destroy the SUPPLIER table use the following statement:
|
||||||
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
DROP TABLE SUPPLIER;
|
DROP TABLE SUPPLIER;
|
||||||
</programlisting>
|
</programlisting>
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
@ -1662,7 +1672,7 @@ The only tuple returned by both parts of the query is the one having $SNO=2$.
|
|||||||
The DROP INDEX command is used to destroy an index:
|
The DROP INDEX command is used to destroy an index:
|
||||||
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
DROP INDEX <replaceable class="parameter">index_name</replaceable>;
|
DROP INDEX <replaceable class="parameter">index_name</replaceable>;
|
||||||
</programlisting>
|
</programlisting>
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
@ -1670,7 +1680,7 @@ The only tuple returned by both parts of the query is the one having $SNO=2$.
|
|||||||
Finally to destroy a given view use the command DROP VIEW:
|
Finally to destroy a given view use the command DROP VIEW:
|
||||||
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
DROP VIEW <replaceable class="parameter">view_name</replaceable>;
|
DROP VIEW <replaceable class="parameter">view_name</replaceable>;
|
||||||
</programlisting>
|
</programlisting>
|
||||||
</para>
|
</para>
|
||||||
</sect3>
|
</sect3>
|
||||||
@ -1689,10 +1699,9 @@ The only tuple returned by both parts of the query is the one having $SNO=2$.
|
|||||||
The syntax is:
|
The syntax is:
|
||||||
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
INSERT INTO <replaceable class="parameter">table_name</replaceable> (<replaceable class="parameter">name_of_attr_1</replaceable>
|
INSERT INTO <replaceable class="parameter">table_name</replaceable> (<replaceable class="parameter">name_of_attr_1</replaceable>
|
||||||
[, <replaceable class="parameter">name_of_attr_2</replaceable> [,...]])
|
[, <replaceable class="parameter">name_of_attr_2</replaceable> [,...]])
|
||||||
VALUES (<replaceable class="parameter">val_attr_1</replaceable>
|
VALUES (<replaceable class="parameter">val_attr_1</replaceable> [, <replaceable class="parameter">val_attr_2</replaceable> [, ...]]);
|
||||||
[, <replaceable class="parameter">val_attr_2</replaceable> [, ...]]);
|
|
||||||
</programlisting>
|
</programlisting>
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
@ -1702,7 +1711,7 @@ The only tuple returned by both parts of the query is the one having $SNO=2$.
|
|||||||
following statement:
|
following statement:
|
||||||
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
INSERT INTO SUPPLIER (SNO, SNAME, CITY)
|
INSERT INTO SUPPLIER (SNO, SNAME, CITY)
|
||||||
VALUES (1, 'Smith', 'London');
|
VALUES (1, 'Smith', 'London');
|
||||||
</programlisting>
|
</programlisting>
|
||||||
</para>
|
</para>
|
||||||
@ -1711,7 +1720,7 @@ The only tuple returned by both parts of the query is the one having $SNO=2$.
|
|||||||
To insert the first tuple into the relation SELLS we use:
|
To insert the first tuple into the relation SELLS we use:
|
||||||
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
INSERT INTO SELLS (SNO, PNO)
|
INSERT INTO SELLS (SNO, PNO)
|
||||||
VALUES (1, 1);
|
VALUES (1, 1);
|
||||||
</programlisting>
|
</programlisting>
|
||||||
</para>
|
</para>
|
||||||
@ -1725,7 +1734,7 @@ The only tuple returned by both parts of the query is the one having $SNO=2$.
|
|||||||
UPDATE command is used. The syntax is:
|
UPDATE command is used. The syntax is:
|
||||||
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
UPDATE <replaceable class="parameter">table_name</replaceable>
|
UPDATE <replaceable class="parameter">table_name</replaceable>
|
||||||
SET <replaceable class="parameter">name_of_attr_1</replaceable> = <replaceable class="parameter">value_1</replaceable>
|
SET <replaceable class="parameter">name_of_attr_1</replaceable> = <replaceable class="parameter">value_1</replaceable>
|
||||||
[, ... [, <replaceable class="parameter">name_of_attr_k</replaceable> = <replaceable class="parameter">value_k</replaceable>]]
|
[, ... [, <replaceable class="parameter">name_of_attr_k</replaceable> = <replaceable class="parameter">value_k</replaceable>]]
|
||||||
WHERE <replaceable class="parameter">condition</replaceable>;
|
WHERE <replaceable class="parameter">condition</replaceable>;
|
||||||
@ -1737,7 +1746,7 @@ The only tuple returned by both parts of the query is the one having $SNO=2$.
|
|||||||
relation PART we use:
|
relation PART we use:
|
||||||
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
UPDATE PART
|
UPDATE PART
|
||||||
SET PRICE = 15
|
SET PRICE = 15
|
||||||
WHERE PNAME = 'Screw';
|
WHERE PNAME = 'Screw';
|
||||||
</programlisting>
|
</programlisting>
|
||||||
@ -1757,7 +1766,7 @@ The only tuple returned by both parts of the query is the one having $SNO=2$.
|
|||||||
FROM. The syntax is:
|
FROM. The syntax is:
|
||||||
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
DELETE FROM <replaceable class="parameter">table_name</replaceable>
|
DELETE FROM <replaceable class="parameter">table_name</replaceable>
|
||||||
WHERE <replaceable class="parameter">condition</replaceable>;
|
WHERE <replaceable class="parameter">condition</replaceable>;
|
||||||
</programlisting>
|
</programlisting>
|
||||||
</para>
|
</para>
|
||||||
@ -1767,7 +1776,7 @@ The only tuple returned by both parts of the query is the one having $SNO=2$.
|
|||||||
following statement is used:
|
following statement is used:
|
||||||
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
DELETE FROM SUPPLIER
|
DELETE FROM SUPPLIER
|
||||||
WHERE SNAME = 'Smith';
|
WHERE SNAME = 'Smith';
|
||||||
</programlisting>
|
</programlisting>
|
||||||
</para>
|
</para>
|
||||||
|
Reference in New Issue
Block a user