ここは 内容が重複しています。
自動起動の 様子を 見てみよう 一度 postgres の logfile を クリヤーして 再起動した場合の 動作 は 以下の 様に なっている
# pwd /home/postgres # ls -l | grep logfile -rw------- 1 postgres postgres 473 Apr 27 22:14 logfile # cat logfile LOG: received fast shutdown request LOG: shutting down LOG: database system is shut down LOG: database system was shut down at 2006-04-27 22:11:16 JST LOG: checkpoint record is at 0/37DF24 LOG: redo record is at 0/37DF24; undo record is at 0/0; shutdown TRUE LOG: next transaction ID: 679; next OID: 24605 LOG: next MultiXactId: 1; next MultiXactOffset: 0 LOG: database system is ready LOG: transaction ID wrap limit is 2147484146, limited by database "postgres" # ps ax | grep post | grep -v grep 109 ? S 0:00 /usr/local/pgsql/bin/postmaster -D /usr/local/pgsql/d 137 ? S 0:00 postgres: writer process 138 ? S 0:00 postgres: stats buffer process 139 ? S 0:00 postgres: stats collector process # ps aux | grep post | grep -v grep postgres 109 0.0 1.0 15300 2676 ? S 22:13 0:00 /usr/local/pgsql/ postgres 137 0.0 1.0 15312 2708 ? S 22:14 0:00 postgres: writer postgres 138 0.0 0.6 6088 1744 ? S 22:14 0:00 postgres: stats b postgres 139 0.0 0.7 5208 1860 ? S 22:14 0:00 postgres: stats c # last | head -2 nyan tty1 Thu Apr 27 22:20 still logged in reboot system boot Thu Apr 27 22:13
現実を 見ておくと 一般ユーザーにて
$ psql -l
        List of databases
   Name    |  Owner   | Encoding 
-----------+----------+----------
 firstdb   | nyan     | EUC_JP
 postgres  | postgres | EUC_JP
 template0 | postgres | EUC_JP
 template1 | postgres | EUC_JP
(4 rows)
一般ユーザー 但し、登録された ユーザーにて の データベースへの アクセス
$ psql -d nyan
psql: FATAL:  database "nyan" does not exist
2005年12月21日 (水) 23:03:13 JST 作成
$ psql -d 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=> 
内容が有るのだろうか
firstdb=> \dt No relations found. firstdb=>
一般ユーザー 但し、登録された ユーザーにて データベースの 作成削除を 復習しておきましょう。
何も無いようですな 終わりましょう
firstdb=> \q $
終わりました復習を兼ねて
データベースを 作成
$ createdb second
CREATE DATABASE
$ psql -l
        List of databases
   Name    |  Owner   | Encoding 
-----------+----------+----------
 firstdb   | nyan     | EUC_JP
 postgres  | postgres | EUC_JP
 second    | nyan     | EUC_JP
 template0 | postgres | EUC_JP
 template1 | postgres | EUC_JP
(5 rows)
ほなら 削除
ほなら 削除 しまひょ
$ dropdb firstdb
DROP DATABASE
$ dropdb second
DROP DATABASE
$ psql -l
        List of databases
   Name    |  Owner   | Encoding 
-----------+----------+----------
 postgres  | postgres | EUC_JP
 template0 | postgres | EUC_JP
 template1 | postgres | EUC_JP
(3 rows)
✈
にゃんたろう 拝!
2006年 4月29日 (土) 21:06:52 JST 作成
前
|**|次
small note on postgresql