Re: Strange Problem

From: Thom Brown <thom(at)linux(dot)com>
To: Tim Sailer <tps(at)unslept(dot)org>
Cc: "pgsql-novice(at)postgresql(dot)org" <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Strange Problem
Date: 2016-02-11 17:39:52
Message-ID: CAA-aLv7vVYk6E6Ddy3gahUPSsqkjqB-q9cD1qq-Tf42-XeAHJg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On 11 February 2016 at 17:30, Tim Sailer <tps(at)unslept(dot)org> wrote:
> I have an application that parses web server log files, and inserts a few
> million rows into a table each month, one table per month. Lately, I've been
> getting reports that there is no recent data, so I went looking. I'll
> concentrate on the first table that seems to have an issue because there are
> a few, all seemingly the same. \dt+ shows the table size of 6463 MB. OK,
> there's data there. "select count(*) from table" comes back with 0; "select
> ctid from table" comes back with 0, but after a while. pg_dump or pg_dumpall
> completely skip the table.
>
> I'm not a complete novice, but I'm stumped. No errors in the OS system logs,
> postgres starts and stops with no errors. This is running on ubuntu
> 14.04.03, with postgres 9.3

There are 2 possibilities I can think of:

1) The application which inserts the rows still has the transaction
open that inserted all the rows, and hasn't yet committed.

2) A transaction is open, but another transaction has since deleted
all the rows and committed, and the open transaction still has
visibility of the rows, so they can't be cleaned up by a vacuum
process.

I'd suggest checking pg_stat_activity for connections with an old
xact_start and a status of 'idle', and also check pg_locks to see if
the affected table is listed as being locked by another process.

Thom

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Tom Lane 2016-02-11 17:53:06 Re: Strange Problem
Previous Message Tim Sailer 2016-02-11 17:30:48 Strange Problem