1.4. �������ݿ�

һ���㴴�������ݿ⣬��Ϳ��Է�������

�������Ҫ���� psql�����鱾�̳��е����ӡ� ����������������Ϊ mydb ���ݿ⼤������

$ psql mydb

�����ʡ�������ݿ����֣���ô��ȱʡ��������û��˺����֡� ���Ѿ���ǰ���С����֪���������ˡ�

�� psql ���ῴ������Ļ�ӭ��Ϣ��

Welcome to psql 8.0.0, the PostgreSQL interactive terminal.

Type:  \copyright for distribution terms
       \h for help with SQL commands
       \? for help with psql commands
       \g or terminate with semicolon to execute query
       \q to quit

mydb=>

���һ��Ҳ������

mydb=#

�����ʾ����ζ���������ݿⳬ���û�������ܳ��������Լ���װ�� PostgreSQL ������¡���Ϊ�����û���ζ���㲻�ܷ��ʿ��Ƶ����ơ� ���ڱ��̵̳�Ŀ�Ķ��ԣ��Ƿ񳬼��û�������Ҫ��

��������� psql ʱ���������⣬��ô�ص�ǰ���С�ڡ� ��� createdb �ķ�������� psql �ķ��������ƣ� ���ǰ����������ô����ҲӦ�������С�

psql ��ӡ�������һ������ʾ��������ʾ psql ��������˵�������ʱ����Ϳ������� SQL ��ѯ��һ�� psql ά���Ĺ������С�����һ����������

mydb=> SELECT version();
                            version
----------------------------------------------------------------
 PostgreSQL 8.0.0 on i586-pc-linux-gnu, compiled by GCC 2.96
(1 row)
mydb=> SELECT current_date;
    date
------------
 2002-08-31
(1 row)

mydb=> SELECT 2 + 2;
 ?column?
----------
        4
(1 row)

psql ������һЩ������ SQL ������ڲ���� �����Է�б�ܿ�ͷ��"\"�� ��Щ���������ڻ�ӭ��Ϣ���г������磬�����������������ȡ����PostgreSQL SQL ����İ����﷨��

mydb=> \h

Ҫ�˳� psql������

mydb=> \q

Ȼ�� psql �ͻ��˳����Ҹ��㷵�ص������� shell�� ��Ҫ��ȡ�����й��ڲ��������Ϣ��������� psql ��ʾ���ϼ��� \?���� psql ������������ Part VI �����ĵ������ PostgreSQL ��װ��ȷ����ô�㻹�����ڲ���ϵͳ�� shell ��ʾ���ϼ��� man psql ���Ķ����ĵ���������ĵ�����ǽ�������ȷʹ����Щ���ԣ��������Լ������ں��ʵ�ʱ��ʹ�����ǡ�