SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
[SA 7.2.338 Pro] Postgresql - improper output datatype

 
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant View previous topic
View next topic
[SA 7.2.338 Pro] Postgresql - improper output datatype
Author Message
michalk



Joined: 29 Aug 2014
Posts: 142

Post [SA 7.2.338 Pro] Postgresql - improper output datatype Reply with quote
Please try

Code:
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 View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 6485

Post Reply with quote
Quote:
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 View user's profile Send private message
michalk



Joined: 29 Aug 2014
Posts: 142

Post Reply with quote
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 View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 6485

Post Reply with quote
Quote:
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 View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 6485

Post Reply with quote
Just in case, here bug tracking # for this issue SA0026521
Thu Jun 11, 2015 9:51 am View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
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


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.