This document summarizes the differences between the ruby-postgres and postgres-pr PostgreSQL database adapters for ActiveRecord in Ruby. It notes that postgres-pr is pure Ruby while ruby-postgres uses the libpq C library. It provides examples showing that postgres-pr is missing some functionality that ruby-postgres has like ParameterStatus support and asynchronous query execution. It concludes that while postgres-pr is useful, it has limitations that may prevent ActiveRecord from working properly, so ruby-postgres is likely better supported.
9. コイツ、、、動くぞ、、、
PGconn.translate_results = false if PGconn.respond_to? :translate_results=
....
if @connection.respond_to?(:status)
...
# TODO: postgres-pr doesn't have PGconn#reset.
if @connection.respond_to?(:reset)
但し、allow_concurrencyだけは使ってはいけない
def query(sql, name = nil) #:nodoc:
log(sql, name) do
if @async
@connection.async_query(sql)
else
@connection.query(sql)
end
end
04:54:22 PM Ruby-Sapporo 2007-11-17 9