[postgresql] やる夫がDB名を変更するようです。
DB名のリネーム
だらだらと書いたけどたいしたこっちゃない。”RENAME TO”で変更可能です。下記例では”yaranaio_db”を”yaruo_db”に変更しています。
postgres=# \l
List of databases
Name | Owner | Encoding
-----------------+----------+----------
postgres | postgres | UTF8
template0 | postgres | UTF8
template1 | postgres | UTF8
yaranaio_db | postgres | UTF8
(4 rows)postgres=# ALTER DATABASE "yaranaio_db" RENAME TO "yaruo_db";
ALTER DATABASE
postgres=# \l
List of databases
Name | Owner | Encoding
-----------------+----------+----------
postgres | postgres | UTF8
template0 | postgres | UTF8
template1 | postgres | UTF8
yaruo_db | postgres | UTF8
(4 rows)
PostgreSQLも別ポートで、DBを立ち上げることが出来るかもしれないが・・・(できないかも)。よくわかってません。とりあえずPostgreSQLのDBは別のdb_nameを与えて上げて管理しています。
この時ばかりはMySQLの方が、使い勝手が良いし構築も楽・・・。
----------------------------------------
オープンソースを使ったデータベースの構築―ApacheサーバとPostgreSQLでデータベース![]() |
| 藤田 泰徳 山崎 文則 セレンディップセレンディップセレンディップ 定価 : ¥ 3,675 2000-09 amazonで詳しく見る |
| 固定リンク
「PostgreSQL」カテゴリの記事
- [postgresql] やる夫がDBのユーザ管理をするようです。(2007.12.27)
- [postgersql] やる夫はsql結果の実行時間を出力させたいようです。(2008.03.04)
- [postgresql] やる夫がmax_connectionsの設定をするようです。(2008.03.11)
- [postgresql] やる夫がDB接続数を確認するようです。(2008.03.19)
- [postgersql] やる夫がDBにアクセス制限をかけるようです。(2008.03.24)


コメント