Recent

Author Topic: Postgres query bug?!  (Read 749 times)

xinyiman

  • Hero Member
  • *****
  • Posts: 2256
    • Lazarus and Free Pascal italian community
Postgres query bug?!
« on: February 11, 2020, 09:27:46 am »
Goodmorning everyone. I encountered an annoying problem in using the standard components for accessing the postgres database. Basically if I use a similar query

select field1, field2, '' as field3, '' as field4 from mytable

It just returns the fields field1 and filed2. The 3 and 4 do not return them. Because?! How do I solve it?
Win10, Ubuntu and Mac
Lazarus: 2.1.0
FPC: 3.3.1

xinyiman

  • Hero Member
  • *****
  • Posts: 2256
    • Lazarus and Free Pascal italian community
Re: Postgres query bug?!
« Reply #1 on: February 11, 2020, 11:16:30 am »
Maybe it can help to isolate the problem. If I write the query it works like this:

select field1, field2, ''::text as field3, ''::text as field4 from mytable

As if the dataset did not recognize the field type.
Win10, Ubuntu and Mac
Lazarus: 2.1.0
FPC: 3.3.1

 

TinyPortal © 2005-2018