Pivotal Labs

Main menu

Skip to primary content
Skip to secondary content
  • About
  • Case Studies
  • Team
    • Executives
    • Locations
      • San Francisco (HQ)
      • Boston
      • Boulder
      • Denver
      • London
      • Los Angeles
      • New York
  • Community
    • Blogs
    • Tech Talks
    • Events
  • Careers
    • Lifestyle
    • Principles & Practices
    • Benefits
    • FAQ
    • Apply
  • Tools
  • Contact
    • Press Room
    • Press Releases
    • In The News
    • Press Kit
  • All
  • Labs
  • Standup
  • Tracker

Postgres features n’ bugs

Will Read
Wednesday, August 8, 2012

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

  • 0 Shares
  • Share on Facebook
  • Share on Twitter

One comment

  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)?

    August 8, 2012 at 10:14 am

Add New Comment Cancel reply

Your email address will not be published.

Will Read

Will Read
San Francisco

Recent Posts

  • XP on Ruby Rogues
  • Cucumber: When to Use It, When to Lose It
  • Org Chart Growth and Keeping Our “Flatness”
Subscribe to Will's Feed

Author Topics

ruby (1)
xp (1)
bloggerdome (4)
cucumber (1)
pm (1)
testing (4)
agile (31)
process (1)
"soft" ware (16)
feedback (1)
engines (1)
documentation (1)
tdd (2)
bdd (1)
breakfast (1)
pairing (1)
api (2)
bug (1)
chore (1)
velocity (1)
oauth (1)
queues (3)
version control (1)
  • About
  • Case Studies
  • Team
  • Community
  • Careers
  • Tools
  • Contact
  • Labs
  • Events

Contact Us

contact@pivotallabs.com
+1 415-77-PIVOT
TwitterLinkedInFacebook

Pivotal Tracker

Tracker is the award-winning agile project management tool that enables real-time collaboration around a shared, prioritized backlog.
Visit pivotaltracker.com >