PostgreSQL 8.0.0 �����ĵ���PostgreSQL �й� ������ | ||||
---|---|---|---|---|
Prev | Fast Backward | Chapter 1. ��ͷ��ʼ | Fast Forward | Next |
һ���㴴�������ݿ⣬��Ϳ��Է�������
���� PostgreSQL �������ն˳��� �� psql�� �������㽻�������룬�༭����ִ�� SQL ���
ʹ���������е�ͼ��ǰ�˹��ߣ����� PgAccess ���ߴ� ODBC ֧�ֵİ칫���������������ݿ⡣ ���ַ�������ݽ̳���û�н��ܡ�
дһ���ͻ�Ӧ�ã�ʹ�ö��������е�һ�֡� ��Щ�������� Part IV ���и���������ۡ�
�������Ҫ���� 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 ���Ķ����ĵ���������ĵ�����ǽ�������ȷʹ����Щ���ԣ��������Լ������ں��ʵ�ʱ��ʹ�����ǡ�