LoginSignup
2
3

More than 5 years have passed since last update.

PostgresでActiveRecordのbinary型で問題

Posted at

Rails3のActiveRecordの型をbinaryにすると
Macでは大丈夫なのにCentOSではDBに保存して取り出すと
値が壊れているような状態に。
bytea_outputの問題?

bytea_output確認

> show bytea_output;
 bytea_output
--------------
 hex
(1 row)

bytea_output変更

> ALTER DATABASE $DB_NAME SET bytea_output TO 'escape';

で直った。

> ALTER DATABASE $DB_NAME SET bytea_output TO 'hex';

で戻せる。

参考

環境

Rails3.2
Postgres9.2

2
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
3