Re: [Fwd: Re: How to trace client sql requests?]

From: Erik Jones <ejones(at)engineyard(dot)com>
To: James B(dot) Byrne <byrnejb(at)harte-lyne(dot)ca>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: [Fwd: Re: How to trace client sql requests?]
Date: 2009-07-10 23:39:00
Message-ID: 25174E8F-8275-4BE0-809D-C2469CCD8CA4@engineyard.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


On Jul 10, 2009, at 1:31 PM, James B. Byrne wrote:

>
>
> On Fri, July 10, 2009 16:10, hubert depesz lubaczewski wrote:
>
>>
>> truncate. but first simple question - did you commit the inserts?
>>
>
> But if it were done with truncate then I would see truncate in the
> log file, yes?
>
> Second, I am working with PG through an ORM called ActiveRecord,
> part of the Rails framework. I do not see a COMMIT anywhere in the
> log. Should I? This is a test run using the Rails test, actually
> cucumber, environment. I know that they do some things differently
> with DB connections in this environment but I believe that this is
> limited to transactions and rollbacks.
>
> The thing is that this problem only arises when testing the script
> inside the test harness. In production it runs just fine. Further,
> if I list the contents of the table from a call in the test harness
> immediately prior to executing the script under test then the data
> is there.

I'm not sure about cucumber but I'm fairly certain that the Rails test
runs don't commit their transactions. That means that if the test
that is not seeing the data is perhaps being run with a different db
connection from that that inserted the data then it won't see it.

Erik Jones, Database Administrator
Engine Yard
Support, Scalability, Reliability
866.518.9273 x 260
Location: US/Pacific
IRC: mage2k

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Sam Mason 2009-07-10 23:46:50 Re: singletons per row in table AND locking response
Previous Message Richard Neill 2009-07-10 23:37:46 BUG #4916: wish: more statistical functions (median, percentiles etc)