Re: Bug in tables column data in postgres database - Mailing list pgsql-sql

From Thomas Kellerer
Subject Re: Bug in tables column data in postgres database
Date
Msg-id c2f62415-0255-73e2-26ee-f552e961051a@gmx.net
Whole thread Raw
In response to Bug in tables column data in postgres database  (Sarita Sharma <saritakumarisharma61@gmail.com>)
List pgsql-sql
Sarita Sharma schrieb am 03.03.2022 um 17:45:
> I am a backend(server side) developer and I am using postgres
> database for storing my data to database. I have find a big challenge
> working with postgres database(version 13) as I have find  major
> issue working with  column in table of database as data keep toggling
> its value.

> eg::
> if I have stored data into table
> bike_table
> ======================================
> bike_name    bike_prefix    bike_line
> V111               V                  111
> W222              W                 222
> X333               X                  333
> ===========================================
> 
> if some other time if query is made for same table data might look like this
> bike_table
> ======================================
> bike_name    bike_prefix    bike_line
> W111               V                  111
> X222              W                  222
> X333               X                  333
> ===========================================
> So usually bike_name  keep changing its name thats seems to me a toggling behaviour.
> Please take this issue as bug and work on this.


It's extremely unlikely that this is a Postgres bug.

What is more likely is, that somewhere in your Java code the values get switched.

One way to find out, is to enable logging of all generated SQL statements
in your Java application. You mentioned JPA, so you are likely to use Hibernate.

This can e.g. be done using:

spring.jpa.show-sql=true
spring.jpa.properties.hibernate.format_sql=true

alternatively do it through the configuration of your logging framework.

You can also use "show_sql" in your persistence.xml if I'm not mistaken
(I don't know the details I keep away from obfuscation layers)

Another option is to turn on logging of all DML statements on the Postgres
side, using "log_statement=mod" in postgresql.conf

I am pretty sure with either one of those approaches you will see
that your application actively sends DML statements that change the data
in the database.

Thomas


pgsql-sql by date:

Previous
From: Sarita Sharma
Date:
Subject: Re: Bug in tables column data in postgres database
Next
From: "David G. Johnston"
Date:
Subject: Re: Bug in tables column data in postgres database