 |
SoftTree Technologies
Technical Support Forums
|
|
Author |
Message |
michalk
Joined: 29 Aug 2014 Posts: 211
|
|
[SA 7.2.338 Pro] Postgresql - improper output datatype |
|
Please try
 |
 |
SELECT date_trunc('second', TIMESTAMP '2015-05-31 23:59:59.83588'); |
Result should be TIMESTAMP WITHOUT TIME ZONE.
SA returns DATE
|
|
Wed Jun 10, 2015 9:32 am |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7948
|
|
|
|
 |
 |
Result should be TIMESTAMP WITHOUT TIME ZONE. |
That's exactly what I get TIMESTAMP WITHOUT TIME ZONE. Please see the mouse-over hint on my screenshot below (click it to enlarge). The display of the value looks like a date because the time portion is 00:00:00 and that part is simply omitted. This is by design in the data grid. If the time is all zeroes, it's committed because in many cases developers use date-time based data types for storing date-only values.

|
|
Wed Jun 10, 2015 11:46 pm |
|
 |
michalk
Joined: 29 Aug 2014 Posts: 211
|
|
|
|
But the result of this date_trunc is not zeroes on hour/min/sec positions.
SELECT date_trunc('second', TIMESTAMP '2015-05-31 23:59:59.83588');
---------------
'2015-05-31 23:59:59'
I found another test case:
SELECT '2015-05-31 22:3:59'::TIMESTAMP
SA shows '2015-05-31' as result.
The same with SELECT NOW();
Looks like general bug. However it shows timestamp correctly if selected from table.
BTW I don't like apps which are trying to be smarter than they are actually. The design you described is not good thing IMO and might be misleading.
At least, It should be configurable (if it isn't already).
|
|
Thu Jun 11, 2015 5:01 am |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7948
|
|
|
|
 |
 |
The same with SELECT NOW(); |
That must be a bug related to incorrect display of PostgreSQL date-time values. I tested the same with MSSQL and MySQL databases and it returned correct date-time value including the time portion. I'm going to submit a ticket for incorrect display of certain types of PostgreSQL data types
|
|
Thu Jun 11, 2015 9:30 am |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7948
|
|
|
|
Just in case, here bug tracking # for this issue SA0026521
|
|
Thu Jun 11, 2015 9:51 am |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|