Re: pg primary key bug? - Mailing list pgsql-sql

From Tom Lane
Subject Re: pg primary key bug?
Date
Msg-id 10956.1109095448@sss.pgh.pa.us
Whole thread Raw
In response to Re: pg primary key bug?  (pginfo <pginfo@t1.unisoftbg.com>)
List pgsql-sql
pginfo <pginfo@t1.unisoftbg.com> writes:
> I will to ask if it will be possible to start some querys (I do not know 
> the query) exactly before running vacuum full and to save the results in 
> some log file. If it is possible, we will be able to post the results to 
> the list in case of  ne problem and to have some start point for 
> reproducing the problem.

Well, you should definitely turn on log_statement across the whole
installation so that you have a complete record of all SQL commands
being issued.  Make sure the log includes timestamps and PIDs.

I would suggest adding a simple probe for duplicate records to the
vacuum script.  Maybe something like
set enable_indexscan to off;select constname,fid,count(*) from a_constants_strgroup by constname,fid having count(*) >
1;

(The indexscan off bit is just paranoia --- I think that an indexscan
might mask the presence of multiple copies of what's supposedly a unique
key.)  Do this just before and just after the vacuum full command.  That
will at least nail down whether vacuum full is creating the dups, and
once we see it happen the trace of the day's SQL commands may give some
ideas where to look.
        regards, tom lane


pgsql-sql by date:

Previous
From: pginfo
Date:
Subject: Re: pg primary key bug?
Next
From: pginfo
Date:
Subject: Re: pg primary key bug?