could not create IPv6 socket: Address family not supported by protocol
というエラーが出てる。
これは
postgresql.conf のlisten_addressを「listen_addresses = '*'」
というデフォルト値から「listen_addresses = '0.0.0.0'」に変更すると回避できるらしいです。PR
WARNING: could not write block 1530 of base/16384/8260301
DETAIL: Multiple failures --- write error might be permanent.
ERROR: xlog flush request 110/4CA5DF8C is not satisfied --- flushed only to 110/4C98BCE4
CONTEXT: writing block 1530 of relation base/16384/8260301
この「8260301」ってのがoidらしい。
find /usr/local/pgsql/data -name 8260301 -ls
とたたくとエラーになっていたファイルが見つかる。
で、これ見つけてどうするんだろう?
なんかbinaryファイルぽいんだけど。。。
結構大きいサイトのpostgresを7系から9系にバージョンアップ。
イメトレしたけどやっぱしひっかかるとこがあったので残します。
ERROR: out of memory
DETAIL: Failed on request of size xxxxx
Index張る時にこんなエラーがなんこか出現。
どうやらメモリが確保できないとかそういった内容みたい。
http://nhh.mo-blog.jp/ttt/2008/05/freebsd_postgre_e31a.html
ここを参考にさせてもらったよ。
postgresでデータを写すときにCSVに書き出して
それをCOPYするっていう方法がある。
select * into temporary aaa _temp from bb where send_date >'2010-01-01';
CSVファイルに書き出す
copy aaa _temp to '/home/postgres/test/mail.bup' CSV;
これを1回でする場合
copy (select * from bb) to '/home/postgres/test.csv' DELIMITER',';
流し込む側のDBに同じ構成のtableを作っておく
copy bb2 from '/home/postgres/flax/mail.bup' USING DELIMITERS ',';
で、これでうまくいったとおもいきや、
***ERROR: invalid input syntax for integer: ""
integerのカラムに空文字を入れるとエラーになるのでなんとかしなきゃいけないよな。。
■postgresのSQLを書く時になるべく早くできるようにメモ■
- WHERE句の抽出条件は、最も制限の強いものから
- ORの代わりにINを使う
code =111 or code=222 or code=333 or code=444 ・・・・ or code=100なら
code in (111,222,333,444・・・・100)
BitmapOr よりもBitmap Indexのほうが早い。→ Index Cond: (code = ANYとなる方が○
でもINのかわりにEXISTSやany(arrayを使うとよいって書いてたけど試すと微妙。
わざわざ手間だししなくてもいいかとおもう。
- Index Scan Backwardの方がよりよい???