Close
Glad You're Ready. Let's Get Started!

Let us know how we can contact you.

Thank you!

We'll respond shortly.

PIVOTAL LABS
Postgres features n' bugs

Interestings

  • Potential Heroku/PG/hstore bug in 9.1.3

One of our tables was using an hstore to collect data (a really big json object). We discovered that the primary database on staging was using PG 9.1.3 while our acceptance & production apps were using 9.1.4. Pushing this very large (58K) object into the hstore caused a Postgres failure:

ActiveRecord::StatementInvalid: PGError: ERROR: cannot execute INSERT in a read-only transaction : INSERT INTO “xxxx” (”created_at”, “data”, “updated_at”, “user_id”) VALUES ($1, $2, $3, $4) RETURNING “id”

while saving the same data into our acceptance app did not cause the error.

We suspect that there is a bug in PG 9.1.3 when inserting “big” strings into an hstore that is fixed in 9.1.4.

We promoted a new 9.1.4 db on our staging app. This cleared our problem.

  • postgresql_cursor and streaming in rails

We were able to stream the contents of a table to the user without loading the whole dataset into memory.

  • RubyConf CFP ends Friday

It’s in Denver this year.
https://rubyconf2012.busyconf.com/proposals/new

Comments
  1. Maciek Sakrejda says:

    Will, I’m from Heroku Postgres. Was that insert error consistently reproducible? Looking at the commits between 9.1.3 and 9.1.4, it’s unlikely that any change there affects your situation. I’ve seen similar errors in our logs, so I’m curious. Also, do you explicitly use read-only transactions anywhere (or implicitly, for that matter) that you know of? And are you using any connection pooling (e.g., Sequel’s)?

Post a Comment

Your Information (Name required. Email address will not be displayed with comment.)

* Copy This Password *

* Type Or Paste Password Here *