データーベース作成
$ createdb firstdb CREATE DATABASE
データーベースに アクセスしてみましょう
$ psql firstdb
Welcome to psql 8.1.1, 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
firstdb=>
tutorial の とうりに やってみましょう
firstdb=> SELECT version();
version
---------------------------------------------------------------
PostgreSQL 8.1.1 on i686-pc-linux-gnu, compiled by GCC 2.95.3
(1 row)
firstdb=>
もうすこし tutorial の とうりに やってみましょう
firstdb=> SELECT current_date;
date
------------
2005-12-22
(1 row)
firstdb=> SELECT 2+2;
?column?
----------
4
(1 row)
firstdb=> \h
Available help:
ABORT CREATE LANGUAGE DROP VIEW
...
CREATE GROUP DROP TYPE
CREATE INDEX DROP USER
firstdb=> \?
General
\c[onnect] [DBNAME|- [USER]]
connect to new database (currently "firstdb")
...
\q quit psql
...
Query Buffer
...
\p show the contents of the query buffer
...
すごいですな?? 終わりましょう
firstdb=> \q $
ううんんんーーん
$ psql database_name(firstdb) /* データーベースにアクセス */ firstdb=> \q /* アクセス 終了 */ $
にゃんたろう 拝!
2005年12月22日 (木) 21:52:13 JST 作成
✈