2006-04-06から1日間の記事一覧

終了する

hellodb=# \q参考ページ:http://www.atmarkit.co.jp/flinux/rensai/postgres02/postgres02.html

データを表示する

hellodb=# select * from test; shainno | shimei - 1 | munetika (1 row)

データを挿入してみる

hellodb=# insert into test (shainno,shimei) values(1,'munetika'); INSERT 17148 1

テーブルを指定して表示

hellodb=# \d test Table "public.test" Column | Type | Modifiers - shainno | integer | shimei | text |

表示してみる

hellodb=# \d List of relations Schema | Name | Type | Owner - public | test | table | postgres (1 row)

データベースを操作する

なんか作る hellodb=# create table test ( shainno number,shimei text);

コマンドラインツールの起動

(postgres)$ psql hellodb

テスト用データベースの作成

(postgres)$ createdb hellodb

必要なら行う。インストール後1回だけ行う

(postgres)$ initdb デーモンの起動 (postgres)$ postmaster -S -i

PostgreSQLスーパーユーザのアカウント(postgres)にパスワードを設定

# passwd postgres $ su - postgres

postgreSQLのお勉強

インストールはインストーラがよきに計らってくれた。