Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
92c001bb
Commit
92c001bb
authored
Dec 17, 2004
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor copy-editing in tutorial.
parent
1ef38f26
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
17 deletions
+17
-17
doc/src/sgml/advanced.sgml
doc/src/sgml/advanced.sgml
+2
-2
doc/src/sgml/query.sgml
doc/src/sgml/query.sgml
+13
-13
doc/src/sgml/start.sgml
doc/src/sgml/start.sgml
+2
-2
No files found.
doc/src/sgml/advanced.sgml
View file @
92c001bb
<!--
<!--
$PostgreSQL: pgsql/doc/src/sgml/advanced.sgml,v 1.4
6 2004/11/15 06:32:13 neilc
Exp $
$PostgreSQL: pgsql/doc/src/sgml/advanced.sgml,v 1.4
7 2004/12/17 04:50:32 tgl
Exp $
-->
-->
<chapter id="tutorial-advanced">
<chapter id="tutorial-advanced">
...
@@ -196,7 +196,7 @@ UPDATE branches SET balance = balance + 100.00
...
@@ -196,7 +196,7 @@ UPDATE branches SET balance = balance + 100.00
and won't be lost even if a crash ensues shortly thereafter.
and won't be lost even if a crash ensues shortly thereafter.
For example, if we are recording a cash withdrawal by Bob,
For example, if we are recording a cash withdrawal by Bob,
we do not want any chance that the debit to his account will
we do not want any chance that the debit to his account will
disappear in a crash just a
s
he walks out the bank door.
disappear in a crash just a
fter
he walks out the bank door.
A transactional database guarantees that all the updates made by
A transactional database guarantees that all the updates made by
a transaction are logged in permanent storage (i.e., on disk) before
a transaction are logged in permanent storage (i.e., on disk) before
the transaction is reported complete.
the transaction is reported complete.
...
...
doc/src/sgml/query.sgml
View file @
92c001bb
<!--
<!--
$PostgreSQL: pgsql/doc/src/sgml/query.sgml,v 1.4
0 2004/11/15 06:32:14 neilc
Exp $
$PostgreSQL: pgsql/doc/src/sgml/query.sgml,v 1.4
1 2004/12/17 04:50:32 tgl
Exp $
-->
-->
<chapter id="tutorial-sql">
<chapter id="tutorial-sql">
...
@@ -154,7 +154,7 @@ CREATE TABLE weather (
...
@@ -154,7 +154,7 @@ CREATE TABLE weather (
</para>
</para>
<para>
<para>
<productname>PostgreSQL</productname> supports the
usual
<productname>PostgreSQL</productname> supports the
standard
<acronym>SQL</acronym> types <type>int</type>,
<acronym>SQL</acronym> types <type>int</type>,
<type>smallint</type>, <type>real</type>, <type>double
<type>smallint</type>, <type>real</type>, <type>double
precision</type>, <type>char(<replaceable>N</>)</type>,
precision</type>, <type>char(<replaceable>N</>)</type>,
...
@@ -297,8 +297,8 @@ SELECT * FROM weather;
...
@@ -297,8 +297,8 @@ SELECT * FROM weather;
<footnote>
<footnote>
<para>
<para>
While <literal>SELECT *</literal> is useful for off-the-cuff
While <literal>SELECT *</literal> is useful for off-the-cuff
queries, it is
considered bad style in production code for
queries, it is
widely considered bad style in production code,
maintenance reasons: adding a column to the table changes
the results.
since adding a column to the table would change
the results.
</para>
</para>
</footnote>
</footnote>
The output should be:
The output should be:
...
@@ -400,9 +400,9 @@ SELECT DISTINCT city
...
@@ -400,9 +400,9 @@ SELECT DISTINCT city
the cities table, and select the pairs of rows where these values match.
the cities table, and select the pairs of rows where these values match.
<note>
<note>
<para>
<para>
This is only a conceptual model. The
actual join may
This is only a conceptual model. The
join is usually performed
be performed in a more efficient manner, but this is invi
sible
in a more efficient manner than actually comparing each pos
sible
to the user.
pair of rows, but this is invisible
to the user.
</para>
</para>
</note>
</note>
This would be accomplished by the following query:
This would be accomplished by the following query:
...
@@ -727,15 +727,15 @@ SELECT city, max(temp_lo)
...
@@ -727,15 +727,15 @@ SELECT city, max(temp_lo)
aggregates are computed. Thus, the
aggregates are computed. Thus, the
<literal>WHERE</literal> clause must not contain aggregate functions;
<literal>WHERE</literal> clause must not contain aggregate functions;
it makes no sense to try to use an aggregate to determine which rows
it makes no sense to try to use an aggregate to determine which rows
will be inputs to the aggregates. On the other hand,
will be inputs to the aggregates. On the other hand,
the
<literal>HAVING</literal> clause always contains aggregate functions.
<literal>HAVING</literal> clause always contains aggregate functions.
(Strictly speaking, you are allowed to write a <literal>HAVING</literal>
(Strictly speaking, you are allowed to write a <literal>HAVING</literal>
clause that doesn't use aggregates, but it's wasteful
:
The same condition
clause that doesn't use aggregates, but it's wasteful
.
The same condition
could be used more efficiently at the <literal>WHERE</literal> stage.)
could be used more efficiently at the <literal>WHERE</literal> stage.)
</para>
</para>
<para>
<para>
Observe that
we can apply the city name restriction in
In the previous example,
we can apply the city name restriction in
<literal>WHERE</literal>, since it needs no aggregate. This is
<literal>WHERE</literal>, since it needs no aggregate. This is
more efficient than adding the restriction to <literal>HAVING</literal>,
more efficient than adding the restriction to <literal>HAVING</literal>,
because we avoid doing the grouping and aggregate calculations
because we avoid doing the grouping and aggregate calculations
...
@@ -788,10 +788,10 @@ SELECT * FROM weather;
...
@@ -788,10 +788,10 @@ SELECT * FROM weather;
</indexterm>
</indexterm>
<para>
<para>
Rows can be removed from a table using the <command>DELETE</command>
command.
Suppose you are no longer interested in the weather of Hayward.
Suppose you are no longer interested in the weather of Hayward.
Then you can do the following to delete those rows from the table.
Then you can do the following to delete those rows from the table:
Deletions are performed using the <command>DELETE</command>
command:
<programlisting>
<programlisting>
DELETE FROM weather WHERE city = 'Hayward';
DELETE FROM weather WHERE city = 'Hayward';
</programlisting>
</programlisting>
...
...
doc/src/sgml/start.sgml
View file @
92c001bb
<!--
<!--
$PostgreSQL: pgsql/doc/src/sgml/start.sgml,v 1.3
6 2004/06/29 19:57:40 petere
Exp $
$PostgreSQL: pgsql/doc/src/sgml/start.sgml,v 1.3
7 2004/12/17 04:50:32 tgl
Exp $
-->
-->
<chapter id="tutorial-start">
<chapter id="tutorial-start">
...
@@ -218,7 +218,7 @@ createdb: database creation failed: ERROR: permission denied to create database
...
@@ -218,7 +218,7 @@ createdb: database creation failed: ERROR: permission denied to create database
operating system account. As it happens, there will always be a
operating system account. As it happens, there will always be a
<productname>PostgreSQL</productname> user account that has the
<productname>PostgreSQL</productname> user account that has the
same name as the operating system user that started the server,
same name as the operating system user that started the server,
and it also happens that th
e
user always has permission to
and it also happens that th
at
user always has permission to
create databases. Instead of logging in as that user you can
create databases. Instead of logging in as that user you can
also specify the <option>-U</option> option everywhere to select
also specify the <option>-U</option> option everywhere to select
a <productname>PostgreSQL</productname> user name to connect as.
a <productname>PostgreSQL</productname> user name to connect as.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment