postgreSQLに関する事

pg_dumpの方法

pg_dump [ダンプしたいDB名] > [dumpファイルの名前]

ex) pg_dump mgc -U test -p 19999 > dumpFile.dump


dumpしたファイルをDBに突っ込む方法

※すでにcreatedbで作成したDBに突っ込むとする。

psql -d [作成されているDB] -f [dumpファイル]

ex) psql -d test -f dumpFile.dump -U postgres


コマンド

\dd table名

ex)

schema Name Object Description(tableのComment)
public table table testTableです

こんな感じで表示される。

\d+ table名

ex)

Column Type Modifiers Description(ColumnのComment)
admin_mail_history_id bigint not null 管理者メール送信履歴のID
create_date timestamp without time zone 作成日

こんな感じで表示される。

最終更新:2009年10月09日 12:35