0

I have a simple Postgres table audit with the following columns

audit
date varchar
record text

The table was autogenerated by Spring Data on the application startup (I did not prepare DDL).

Now when I'm creating dataclip

select * from audit

it's returning me for example:

2021-11-24 22836979
2021-11-23 22785154
2021-11-25 22845754
2021-11-26 22858755
2021-11-27 22864701

however there are some text values in record column (my Spring Boot application is able to parse it and display on front end of my application)

Why is this happening? Is it specific to Heroku Dataclips tool?

m.antkowicz
  • 13,268
  • 18
  • 37
  • `date varchar` Date is a keyword, you should give it a different name. And if it is a `date`, why not store it in a `DATE` type column? (BTW: `RECORD` is a keyword, too) – wildplasser Feb 01 '22 at 12:18
  • Maybe you are right but it's working completely fine, the application is reading values properly just Heroku Dataclips for some reason does not display text value. Thanks for your suggestions - this is super simple table and the business meaning of 'date' column is not to keep there a real date just to make sure that audit is saved once per day - it could be even int counter. – m.antkowicz Feb 01 '22 at 12:29
  • I'd trust Heroku's output, but double-check in a database client of your choosing. Are you sure Spring isn't doing some magic behind the scenes? – ChrisGPT was on strike Feb 01 '22 at 12:43
  • Ok I guess I found the issue - I declared the field (column) as a `LOB` and seems that fetching it is quite problematic in general (not only in Heroku) – m.antkowicz Feb 01 '22 at 12:47
  • This one helped me https://stackoverflow.com/questions/12155648/how-to-fetch-text-column-value-from-postgresql (however I'm not sure is this the simplest way) – m.antkowicz Feb 01 '22 at 12:48

0 Answers0