pgadmin4/web/pgadmin/utils/driver
Surinder Kumar 5dbbd8e638 Resolve problem displaying intervals and timestamps. Fixes #1352
1) No handling for INTERVAL type datetime.
For example: executing query
SELECT INTERVAL '15 minutes';
throws json serialization error, because it returns time in timedelta format which is not handled.

Added support to handle timedelta datetime format in DataTypeJSONEncoder class

2) When we try to get BC dates from database raises ValueError: year is out of range
For eg:
SELECT TIMESTAMP '0044-03-15 10:00:00 BC',
It is because pyscopg2 doesn't handle BC datetime format.

So we have defined our method which type cast the datetime value to string in pyscopg2 overriding default behaviour.

Reference:
http://initd.org/psycopg/docs/advanced.html#type-casting-from-sql-to-python
ccf3693be6/pgcli/pgexecute.py
2016-06-14 17:09:47 +01:00
..
psycopg2 Resolve problem displaying intervals and timestamps. Fixes #1352 2016-06-14 17:09:47 +01:00
__init__.py Copyright updates for 2016. 2016-01-18 14:48:14 +00:00
abstract.py Add support for an affected row count property to the DB interface. 2016-04-12 17:02:54 +01:00
registry.py First round of string review and cleanup. 2016-05-06 13:53:48 +01:00