Re: Table dublicates values - Mailing list pgsql-general

From Adrian Klaver
Subject Re: Table dublicates values
Date
Msg-id 201107160955.36133.adrian.klaver@gmail.com
Whole thread Raw
In response to Table dublicates values  (Deniz Atak <denizatak@gmail.com>)
List pgsql-general
On Saturday, July 16, 2011 1:47:50 am Deniz Atak wrote:
> Hi all,
>
> I am using postgresql on Glassfish server. When I restart the server for
> some reason, one of my databases' tables duplicates the values. For example
> aTable is from aDatabase:
>
> select * from aTable
>  col1                | col2
> -----------------------+---------
>  text/html         |    1672
>  text/javascript |     374
>  text/css          |      94
>  text/xml          |      21
>  text/plain        |      14
>  text/html         |    1672
>  text/javascript |     374
>  text/css          |      94
>  text/xml          |      21
>  text/plain         |      14
>
> Do you have any opinion why this is happening? I can write a workaround
> code to handle this situtation but I want to learn the reason for this. If
> someone has any opinion about this issue it will be highly appreciated.
> Thanks in advance.

If it is possible, put a unique index on the (col1,col2) combination and check
the logs for the action that trips the index. My wild guess is that the
application is caching values that are then flushed to the server on restart.

--
Adrian Klaver
adrian.klaver@gmail.com

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Slow query with sub-select
Next
From: Michael Nolan
Date:
Subject: Re: Slow query with sub-select