]> begriffs open source - ai-pg/blob - full-docs/txt/tutorial-sql-intro.txt
Convert HTML docs to more streamlined TXT
[ai-pg] / full-docs / txt / tutorial-sql-intro.txt
1
2 2.1. Introduction #
3
4    This chapter provides an overview of how to use SQL to perform simple
5    operations. This tutorial is only intended to give you an introduction
6    and is in no way a complete tutorial on SQL. Numerous books have been
7    written on SQL, including [melt93] and [date97]. You should be aware
8    that some PostgreSQL language features are extensions to the standard.
9
10    In the examples that follow, we assume that you have created a database
11    named mydb, as described in the previous chapter, and have been able to
12    start psql.
13
14    Examples in this manual can also be found in the PostgreSQL source
15    distribution in the directory src/tutorial/. (Binary distributions of
16    PostgreSQL might not provide those files.) To use those files, first
17    change to that directory and run make:
18 $ cd .../src/tutorial
19 $ make
20
21    This creates the scripts and compiles the C files containing
22    user-defined functions and types. Then, to start the tutorial, do the
23    following:
24 $ psql -s mydb
25
26 ...
27
28 mydb=> \i basics.sql
29
30    The \i command reads in commands from the specified file. psql's -s
31    option puts you in single step mode which pauses before sending each
32    statement to the server. The commands used in this section are in the
33    file basics.sql.