Recent

Author Topic: Wrong data content (Lazarus SQLDB and PostgreSQL 15)  (Read 580 times)

dcosta

  • Newbie
  • Posts: 2
Wrong data content (Lazarus SQLDB and PostgreSQL 15)
« on: January 12, 2023, 10:43:57 pm »
Hi.

I'm developing a small 64-bit application with Postgresql 15 and, usually, at intervals
I make a new copy of the application directory as a backup.

In a data module of the application I have a TPQConection, a TSQLTransacion, a TSQLQuery
and a TDataSource.
The application used to show the data, correctly, in a DBgrid correctly.

A few days ago I found that the data grid shows the data in all date columns and the integer
columns, in all rows, with 12-31-9999 date instead of the correct date and in all integer columns
the value is huge and all but the original values in the table.

In the last backup the date in the application grid is correct.
I can't recall I made any changes in the data module and testing in a new application shows
the same problem.

Even executing the SQL in the TSQLQuery SQL little window shows the same wrong data.

Trying to resolve the problem I installed the latest version of Lazarus and replaced all the
Postgresql libs in the application and in the Lazarus and Windows (path) directory.

Does someone can help me, please?
Dias Costa

Nicole

  • Hero Member
  • *****
  • Posts: 970
Re: Wrong data content (Lazarus SQLDB and PostgreSQL 15)
« Reply #1 on: January 14, 2023, 08:09:46 pm »
Date problems are annoying, I have them very often and rarely can solve them quickly.
Let us look at your data, I read.

12-31-9999

This is US style, in Europe they would be 21.12.9999

So check any interfaces, where you can configure the data. This may be the field of the DBGrid, the query editor, the comumn editor of the dbgrid.

If you do not find anything, go back until you are in a direct query to the DB.

I would expect to find the problem in an interaction of query-editor and DBGrid-field editor. Try to delete all of it and re-add. These 2 editors are evil creatures (smile) and trick us in a way, the compiler would not recognize.


MarkMLl

  • Hero Member
  • *****
  • Posts: 6686
Re: Wrong data content (Lazarus SQLDB and PostgreSQL 15)
« Reply #2 on: January 14, 2023, 08:58:06 pm »
What happens if you execute the same SQL using the psql utility?

If there's a difference in interpretation then I think it would be appropriate to raise an FPC bug report.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

 

TinyPortal © 2005-2018