Commit Graph

290 Commits (740ce15bd73c7820fe91372bf512b663dd2604c4)

Author SHA1 Message Date
Akshay Joshi b91f6f0f5c Fixed an issue where the semicolon is misplaced in RLS Policy SQL.
Fixed one regression issue introduced by renaming the method 'gc' to 'gc_timeout'.
2020-06-26 19:24:54 +05:30
Satish V 830ac1cc91 Fixed following SonarQube issues:
1. Method/Field names should comply with a naming convention.
 2. Conditionals should start on new lines
2020-06-26 13:32:45 +05:30
Aditya Toshniwal d3b3d07f2e Fixed SonarQube issues with the tag unused. All the unused variables, assignments, code comments are fixed. 2020-06-25 11:09:43 +05:30
Satish V a1fd9ea3ce Fixed issue related to extra semicolons and function naming convention reported by SonarQube. 2020-06-24 16:16:12 +05:30
Yogesh Mahajan caebdcfa91 Ensure that the query tool should display the proper error message while terminating the active session. Fixes #3591 2020-06-22 17:09:10 +05:30
Aditya Toshniwal 641f7bbe9d Some clumsy coding related fixes reported by SonarQube. 2020-06-15 16:50:07 +05:30
Yogesh Mahajan 92d9c41da7 Fixed connection and version number detection issue when the database server is upgraded. Fixes #5507 2020-06-04 18:18:11 +05:30
Satish V d22e276586 Ensure that proper error should be displayed for the deleted node. Fixes #3669 2020-06-03 11:26:26 +05:30
Khushboo Vashi 0f56c25893 Changed the user identity from email to username in the log file.
refs #5452
2020-05-18 11:01:20 +05:30
Akshay Joshi c0451cd454 Added connected pgAdmin user and connection name in the log file. Fixes #5452
Patch By: Nico T
2020-05-13 17:43:21 +05:30
Akshay Joshi 46e9924ebb Fixed Unicode decode error 'utf-8' codec can't decode byte. Fixes #5510
It's a regression of commit id: 04d6d4e2ccc129baa698471ce0680ccabe2282be
2020-05-12 17:22:22 +05:30
Ashesh Vashi e73e2d2502 Fixed the errors, and warnings reported by pylama.
TODO::
- Don't use unicode in Python 3 for removing the support of Python 2 (
  psycopg2 driver - __init__.py, server_manager.py).
- Merge the lastest pgcli (version: 3.0.0) for SQL autocompletion.
2020-05-08 14:13:38 +05:30
Khushboo Vashi d68e6bd892 Remove Python2 modules.
refs #5443
2020-05-08 12:28:21 +05:30
Dave Page 04d6d4e2cc Remove support for Python 2. Fixes #5443 2020-05-04 14:58:49 +01:00
Akshay Joshi ad80217593 Remove Python2 references from the source code.
refs #5443

Initial patch: Neel Patel
2020-04-30 17:22:48 +05:30
Libor M 6a9af07f7a Fixed gettext usage:
- fixed gettext usage with .format() only for original text with %s
  - fixed typos
  - fixed translation yes/no buttons in the dialog.
  - improved translating sentences without "connecting" words (eg. see web/pgadmin/dashboard/static/js/dashboard.js,
     word 'cancel' needs to be translated in the Czech language as 'zrušit' but in another sentence as 'zrušení')
  - added gettext for text translations.
2020-04-10 14:52:41 +05:30
Aditya Toshniwal c9d04684ce Ensure that all the transactions should be canceled before closing the connections when a server is disconnected using pgAdmin. Fixes #5142 2020-02-28 14:12:44 +05:30
Aditya Toshniwal 915b09255c Added Python 3.8 support. Fixes #5179
1) Upgraded passlib==1.7.1 to passlib==1.7.2
2) Replace unmaintained Flask-Security with maintained Flask-Security-Too package, which is also compatible with python 3.8
3) Other compatibility code changes.
2020-02-18 12:10:38 +05:30
Dave Page 01c7636c75 Update copyright notices for 2020. 2020-01-02 14:43:50 +00:00
Aditya Toshniwal 4ed2d74d9c 1) Fix network disconnect issue while establishing the connection via SSH Tunnel and it impossible to expand the Servers node. Fixes #4724.
2) Fix server connection drops out issue in query tool. Fixes #4818
3) Fix VPN network disconnect issue where pgAdmin4 hangs on expanding the Servers node. Fixes #4926.
4) Ensure that the Servers collection node should expand independently of server connections. Fixes #4933.

Set the default connection timeout to 10 seconds instead of 0.
2019-11-26 09:04:41 +05:30
Akshay Joshi f22134dabd Ensure that the superuser should be able to create database and role, as the superuser
overrides all the access restrictions.
Fixes #4792 Fixes #4878
2019-11-14 18:14:53 +05:30
Yosry Muhammad 687204771c Add support in query history to show internal queries generated by pgAdmin during save data operations. Fixes #4612 2019-08-16 17:17:12 +05:30
Akshay Joshi 776884860e Ensure parameter values are quoted when needed when editing roles. Fixes #4393 2019-07-04 15:00:29 +01:00
Aditya Toshniwal 0d42f8026c Fix SSH tunnel password decryption. Fixes #4320 2019-06-25 07:06:04 -04:00
Aditya Toshniwal 6e8ebbd375 Allow editing of data where a primary key column includes a % sign in the value. Fixes #4036
Fix an XSS issue seen in View/Edit data mode if a column name includes HTML. Fixes #4367
2019-06-20 12:21:37 +01:00
Aditya Toshniwal 82bd94e696 Fix connection restoration issue when pgAdmin server is restarted and the page is refreshed. Fixes #4357 2019-06-14 11:50:01 +05:30
Aditya Toshniwal a588c2994d 1) Fix issue where SSH tunnel connection using password is failing, it's regression of Master Password. Fixes #4320
2) Fix some more issues related to SSH Tunnel(By: Akshay Joshi)
2019-06-05 12:07:24 +05:30
Akshay Joshi aa95ff9f57 Fix encoding issue for background process, it is regression of Master Password. Fixes #4303 2019-05-29 12:50:48 +05:30
Aditya Toshniwal dfa892d2a2 1. Added Master Password to increase the security of saved passwords. Fixes #4184
2. In server(web) mode, update all the saved server credentials when user password is changed. Fixes #3377
2019-05-28 12:00:18 +05:30
Khushboo Vashi c21ea3c342 Ensure that pgAdmin4 should work properly with psycopg2 v2.8. Fixes #4143 2019-04-08 17:49:50 +05:30
Aditya Toshniwal 7627e9c699 Display errors during CSV download from the Query Tool in the UI rather than putting them in the CSV file. Fixes #4085
Ensure the toolbar buttons are properly reset following a CSV download in the Query Tool. Fixes #4096
2019-03-29 14:31:33 +00:00
Khushboo Vashi e4417229aa Update all Python and JS dependencies. Fixes #4019 2019-03-14 15:11:16 +00:00
Khushboo Vashi efeb9d6d20 Fix regression issue caused due to encoding fixes. 2019-03-04 16:11:20 +05:30
Khushboo Vashi 849e34c2f7 Add full support and testsfor all PG server side encodings. Fixes #3992. Fixes #3982. Fixes #3911 2019-03-01 13:51:50 +00:00
Aditya Toshniwal e6e7cf0f69 Fix support for bigint's in JSONB data. Fixes #3587 2019-02-27 13:39:47 +00:00
Aditya Toshniwal 59446bb4b5 Ensure JSON data isn't modified in-flight by psycopg2 when using View/Edit data. Fixes #3600 2019-02-25 10:34:36 +00:00
Khushboo Vashi 34045efb38 Modify the Download as CSV option to use the same connection as the Query Tool its running in so temporary tables etc. can be used. Fixes #3673 2019-02-20 11:49:45 +00:00
Aditya Toshniwal 292ac32db5 Fix editing of table data with a JSON primary key. Fixes #3912 2019-02-20 11:15:39 +00:00
Ashesh Vashi eb3d3980e0 Use 'set_config(...)' function to update the 'bytea_output' settings
instead of 'UPDATE' statement, which is not allowed in the the read-only
instances.

Reported by: Robert J. Rotter
Solution provided by: Tom Lane

Fixes #3973
2019-02-08 10:18:32 +05:30
Murtuza Zabuawala d9fc9fdc4d Ensure object names in external process dialogues are properly escaped. Fixes #3872 2019-01-24 16:34:18 +00:00
Diego Augusto Molina d92368f8e5 Use 'UPDATE pg_settings' for setting bytea_output as a
convenience hack for those running on old, unsupported versions of
PostgreSQL 'cos we're nice like that.
2019-01-22 15:56:29 +00:00
Dave Page 14f462e9dc Fix PEP-8 issues. 2019-01-11 22:13:17 +05:30
Aditya Toshniwal d641b47adb Make the browser more robust in the face of multibyte characters in SQL_ASCII databases. Fixes #3877 2019-01-11 21:55:49 +05:30
Murtuza Zabuawala e23d307c56 Update copyright notices for 2019 2019-01-02 15:54:12 +05:30
Akshay Joshi 41c028f944 Ensure that null values handled properly in CSV download. Fixes #3780 2019-01-01 15:15:36 +05:30
Khushboo Vashi e666b0fab0 Fix an issue that could cause the Query Tool to fail to render. Fixes #3433 2018-12-13 11:15:55 +00:00
Dave Page 980d1e0292 Fix PEP8 issue. 2018-12-04 17:07:41 +00:00
Khushboo Vashi 7e3bd8b88a Fix an encoding issue in the query tool. Fixes #3711 2018-12-04 17:03:19 +00:00
Akshay Joshi eae18f6f14 Ensure previous notices are not removed from the Messages tab in the Query Tool if an error occurs during query execution. Fixes #3016 2018-11-14 08:27:47 -05:00
Harshal Dhumal 822d384746 Purge connections from the cache on logout. Fixes #3703 2018-10-17 12:42:41 +01:00
Harshal Dhumal ce31726af5 Fix connection garbage collector. Fixes #3700 2018-10-17 12:35:45 +01:00
Akshay Joshi 15fe26a710 Fix handling of backslashes in the edit grid. Fixes #3551 2018-09-25 10:34:33 -04:00
Akshay Joshi c8c5f83dfe Add support to save and clear SSH Tunnel password. Fixes #3511 2018-08-06 15:56:46 +05:30
Akshay Joshi 52fc0846cd pgAdmin4 should work with python 3.7, Fixes #3458 2018-08-06 15:35:03 +05:30
Akshay Joshi 213cb440d0 Add support for SCRAM password changes (requires psycopg2 >= 2.8). Fixes #2214 2018-07-23 15:03:44 +01:00
Akshay Joshi 051ce6afeb Ensure the SSH tunnel port number is honoured. Fixes #3471 2018-07-19 10:52:16 +01:00
Akshay Joshi ce768c7f8a Support SSH tunneling with keys that don't have a passphrase. Fixes #3468 2018-07-18 14:15:05 +01:00
Dave Page 4ba0e1a6f3 Fix Python 2.6 support for SQL_ASCII data in the query tool. 2018-06-21 17:06:28 -04:00
Aditya Toshniwal df85392bbf Fix handling of SQL_ASCII data in the query tool. Fixes #3289. Fixes #3250 2018-06-21 08:26:01 -04:00
Akshay Joshi 7a06acb678 Allow the connection timeout to be configured on a per-server basis. Fixes #3388 2018-06-19 19:58:46 -04:00
Akshay Joshi 38ee39ae7a Add support for LISTEN/NOTIFY in the query tool. Fixes #3204 2018-05-30 21:58:28 -04:00
Akshay Joshi 17977d5d0e Fix dropping of databases over SSH tunneled connections. Fixes #3357 2018-05-28 17:37:24 -04:00
Akshay Joshi b7fb01ab04 Add support for SSH tunneled connections. Fixes #1447 2018-05-04 11:27:27 +01:00
Murtuza Zabuawala be055ce57d Update Python and JS modules. Fixes #3154 2018-04-04 10:47:01 +01:00
Akshay Joshi 1baddd5e9a Decode the severity field in database exception objects properly. Fixes #3090 2018-03-26 13:59:49 +01:00
Akshay Joshi 637f3b9d1a Fix a number of broken connection detection scenarios. 2018-03-21 08:38:18 +00:00
Murtuza Zabuawala 03b772bf64 Add support for connecting using pg_service.conf files. Fixes #3140 2018-03-12 16:45:56 -04:00
Khushboo Vashi d3c303e455 Ensure all messages are retrieved from the server in the Query Tool. Fixes #3094 2018-03-07 13:38:27 +00:00
Dave Page bcdb8eb275 Revert "Ensure we pick up the messages from the current query and not a previous one. Fixes #3094"
This reverts commit 08b3ccc01a.
It was found that this fix inadvertently re-introduces #1523
2018-02-26 16:32:53 +00:00
Khushboo Vashi 08b3ccc01a Ensure we pick up the messages from the current query and not a previous one. Fixes #3094 2018-02-26 14:19:43 +00:00
Harshal Dhumal 05e91044c7 Fix intermittent specified_version_number ValueError issue on restart. Fixes #2983
Now we try to restore server details like server version number at restart so template paths can be resolved.
2018-02-20 17:31:13 +00:00
Murtuza Zabuawala 25647c16ba Ensure we capture notices raised by queries. Fixes #3027 2018-02-02 15:23:33 +01:00
Harshal Dhumal 2042f89ce0 Don't include sizes on primitive datatypes that shouldn't have them when modifying columns. Fixes #3052 2018-02-01 16:27:36 +01:00
Harshal Dhumal e0da9c5a0c Significantly improve connection loss detection and handling in the query tool. Fixes #2815 2018-02-01 14:29:18 +01:00
Murtuza Zabuawala c3ddb7df38 PEP8 fixes for the utils module. Fixes #3076 2018-01-31 13:58:55 +00:00
Dave Page 89821c0d19 Update copyright notices for 2018. 2018-01-05 10:42:50 +00:00
Murtuza Zabuawala 1dd1c10255 Do not decrypt the password when the password is 'None'. Fixes #2765
This should avoid the common but harmless exception "ValueError: IV must be 16 bytes long while decrypting the password."
2018-01-03 13:19:58 +00:00
Murtuza Zabuawala 4246a3b22f Ensure password changes are successful if authenticating using a pgpass file. Fixes #2720 2017-12-13 13:28:07 +00:00
Harshal Dhumal 55254a649f Re-hash the way that we handle rendering of special types such as arrays. Fixes #2782. Fixes #2822. 2017-12-13 11:53:27 +00:00
Murtuza Zabuawala fe7cfa35df Attempt to decode database errors based on lc_messages. Fixes #2806. Fixes #2821 2017-11-27 11:53:25 +00:00
Khushboo Vashi 4568fe22f7 Decode the field separator and quote char if needed. 2017-11-20 16:28:13 +00:00
Khushboo Vashi 0c566f132e Allow configuration of CSV and clipboard formatting of query results. Fixes #2781 2017-11-20 13:50:47 +00:00
Murtuza Zabuawala 2579458091 Fix support for time without timezone. Fixes #2881 2017-11-20 13:36:50 +00:00
Alexander Lakhin 23d431fb54 Remove more exclamation marks from error messages. 2017-11-01 15:18:07 +00:00
Harshal Dhumal 04beec1309 Fix various issues that could cause an exception on startup. Fixes #2713 2017-10-10 09:50:47 +01:00
Murtuza Zabuawala 2f5a2b2392 Only allow specification of a pgpass file if libpq >= 10. Fixes #2768 2017-10-10 09:31:27 +01:00
Murtuza Zabuawala f855ed88ce Allow selection of SSL certificates and pgpass files in connection properties. Fixes #2649. Fixes #2650 2017-09-28 10:02:33 +01:00
Murtuza Zabuawala 2ddbddba33 Improve display of error messages in the query tool. Fixes #2700 2017-09-20 11:29:24 +01:00
Harshal Dhumal 30e7016077 Changed array representation and formatting for the data types in Query Tool and View Data. Fixes #2671 2017-09-18 12:07:15 +05:30
Atul Sharma 70418144cf Add a field to the Server Dialogue allowing users to specify a subset of databases they'd like to see in the treeview. Fixes #1918 2017-07-21 12:44:57 +01:00
Harshal Dhumal 54882e061c Don't attempt to render binary data in the query tool result grid. Fixes #2080. Fixes #2074. 2017-07-20 13:09:47 +01:00
Harshal Dhumal c65158312d Use on-demand loading for results in the query tool. Fixes #2137
With a 27420 row query, pgAdmin III runs the query in 5.873s on my laptop. pgAdmin 4 now takes ~1s.
2017-06-27 09:03:04 -04:00
Atul Sharma 15cb9fc35b Add support for the hostaddr connection parameter. This helps us play nicely with Kerberos/SSPI and friends. Fixes #2191 2017-06-26 15:48:59 -04:00
Murtuza Zabuawala d2ba57c1ab Properly handle bytea[], and 'infinity'::real/real[]. Fixes #2498. Fixes #2502. 2017-06-20 10:19:11 +01:00
Murtuza Zabuawala 3bcbc50525 Fix the handling of double precision[] type. Fixes #1928 2017-06-08 14:50:51 +01:00
Murtuza Zabuawala 678b891ff7 Fix an intermittent error seen during result polling. Fixes #2470 2017-06-08 12:34:14 +01:00
Murtuza Zabuawala 05787fdba9 Properly handle non-ASCII column names in CSV. Fixes #2314 2017-05-12 10:38:23 +01:00
Murtuza Zabuawala 63d42745ef Fix various issues in CSV file download feature:
1) To handle non-ascii filenames which we set from table name. Fixes #2314

2) To handle non-ascii query data. Fixes #2253

3) To dump JSON type columns properly in csv. Fixes #2360
2017-05-08 13:36:11 +01:00
Harshal Dhumal a80f760933 Only reconnect to databases that were previously connected. Fixes #2292 2017-05-08 12:36:51 +01:00
Murtuza Zabuawala 38c8a4fb60 Fix handling of bigint[] type. Fixes #2272 2017-04-25 12:24:02 +05:30
RAJASEKAR G 024b97479d Recover properly if a database is renamed externally. Fixes #2077 2017-04-10 11:09:01 +01:00
Jonas Thelemann ea2b3f43bd Remove unnecessary quotes. 2017-04-05 13:58:47 +01:00
Jonas Thelemann 65f21a8cd7 Replace all occurrences of "can not" with "cannot". 2017-04-05 13:38:14 +01:00
Harshal Dhumal 9acf340400 Generic function qtLiteral was not adapting values properly when they contain non ascii characters. Fixes #2305 2017-03-31 21:11:25 -04:00
Dave Page 6152d73f13 Fix some code inspection complaints 2017-03-25 22:04:52 -04:00
Murtuza Zabuawala d4e88217eb Added timeout in _wait_timeout function in our psycopg2 module.
Fixes debugger module, Added common function to covert 2d array data to dict for BackGrid.
2017-03-24 14:01:59 +05:30
Surinder Kumar aee1492d0d Correct some EDB Postgres Advanced Server branding. 2017-03-21 10:12:26 +00:00
Murtuza Zabuawala e9702752d9 Fix hadling of DATERANGE[] type. Fixes #2258 2017-03-17 12:40:08 +00:00
Harshal Dhumal e4134695e5 Fix dropping of databases with Unicode names. Fixes #2243
1. Pickup correct encoding in qtLiteral to decode.
2. While releasing database connection only decode database name if it's not unicode.
2017-03-17 10:33:03 +00:00
Jonas Thelemann c34f5fd2d4 Use "could not" consistently, instead of "couldn't" which was used in some places. 2017-03-07 10:29:54 +00:00
Ashesh Vashi f2fc1ceba8 Resolved quite a few file-system encoding/decoding related cases.
In order to resolve the non-ascii characters in path (in user directory,
storage path, etc) on windows, we have converted the path into the
short-path, so that - we don't need to deal with the encoding issues
(specially with Python 2).

We've resolved majority of the issues with this patch.
We still need couple issues to resolve after this in the same area.

TODO
* Add better support for non-ascii characters in the database name on
  windows with Python 3
* Improve the messages created after the background processes by
  different modules (such as Backup, Restore, Import/Export, etc.),
  which does not show short-paths, and xml representable characters for
  non-ascii characters, when found in the database objects, and the file
  PATH.

Fixes #2174, #1797, #2166, #1940

Initial patch by: Surinder Kumar
Reviewed by: Murtuza Zabuawala
2017-03-07 15:31:03 +05:30
Harshal Dhumal ffa8d94e76 Better handling the non-ascii characters for different database objects.
Using 'psycopg2.extensions.UNICODE' (for Python < 3) in the psycopg2
driver for proper conversation of unicode characters. Also - adjusted
the string typecaster to take care of different character types (char,
character, text, name, character varying, and their array types).

Reviewed by: Dave Page, Murtuza Zabuawala & Akshay Joshi
2017-03-02 15:09:28 +05:30
Murtuza Zabuawala 480e00fddf Query tool efficiency.Convert the data as a 2D array instead of dict. Fixes #2036
Incremental back off when polling. Fixes #2038

Initial Patch By: Dave Page
2017-03-01 16:58:51 +05:30
Surinder Kumar 88cae263b2 Fix display of long integers and decimals. Fixes #2039. Fixes #2119. Fixes #2154 2017-02-24 13:39:40 +00:00
Murtuza Zabuawala 9ad1316990 Various encoding fixes. Fixes #2160 2017-02-16 11:00:40 +00:00
Murtuza Zabuawala 2d442da9ff Properly handle setting comments and other options on databases with allowconn = False. Fixes #2024 2017-02-01 10:23:45 +00:00
Dave Page f221194bcc Update copyright notices for 2017. 2017-01-04 13:33:32 +00:00
Dave Page ca333ea6a7 Don't strip \r\n from "Download as CSV" batches of rows, as it leads to malformed data. Fixes #1936 2016-11-07 14:47:50 +00:00
Murtuza Zabuawala bde3dd845b Fix SSL setup. Fixes #1817 2016-10-05 13:05:10 +01:00
Ashesh Vashi 09c2d605c9 Prevent bigints getting rounded. Fixes #1547 2016-09-26 15:51:01 +01:00
Harshal Dhumal f117685d77 Drop all connections from the connection manager when a server is dropped to avoid issues if sqlite reuses an ID. Fixes #1720 2016-09-22 12:57:52 +01:00
Surinder Kumar 28ce31a022 Save error details when executing to CSV, if no data is returned. This ensures the user gets some feedback rather than nothing at all. Fixes #1592 2016-09-20 11:57:51 +01:00
Murtuza Zabuawala 881d2a60a4 Fix an exception that could occur when the browser pings the server following a restart. Fixes #1707 2016-09-19 15:57:52 +01:00
Murtuza Zabuawala 42e19d2169 Fix error highlighting, broken in d6391c7e9b. Fixes #1676 2016-09-09 14:45:03 +01:00
Surinder Kumar da21cabb1e Fix typo in connection handler. 2016-09-07 14:01:56 +01:00
Murtuza Zabuawala 679ad6fca8 Support range types in the query tool. Fixes #1658 2016-09-06 14:26:43 +01:00
Murtuza Zabuawala 1b75679ec4 Python 2.6 fixes. Fixes #1636. Fixes #1659 2016-09-06 14:07:30 +01:00
Ashesh Vashi 8ac65070bc Improve the logic for Bad handling of missing connection database server RM #1387 2016-09-06 15:35:20 +05:30
Ashesh Vashi f12d981a9d Handling the bad/lost connection of a database server.
Made backend changes for:
* Taking care of the connection status in the psycopg2 driver. And, when
  the connection is lost, it throws a exception with 503 http status
  message, and connection lost information in it.
* Allowing the flask application to propagate the exceptions even in the
  release mode.
* Utilising the existing password (while reconnection, if not
  disconnected explicitly).
* Introduced a new ajax response message 'service_unavailable' (http
  status code: 503), which suggests temporary service unavailable.

Client (front-end) changes:
* To handle the connection lost of a database server for different
  operations by generating proper events, and handle them properly.

Removed the connection status check code from different nodes, so that
- it generates the proper exception, when accessing the non-alive
  connection.

Fixes #1387
2016-08-29 12:01:35 +05:30
Murtuza Zabuawala d6391c7e9b Properly display messages from the server in the query tool. Fixes #1523 2016-08-18 17:08:40 +01:00
Murtuza Zabuawala 01252a13cf Further misc quoting/encoding related fixes. 2016-08-01 15:23:06 +01:00
Murtuza Zabuawala 06e881570a Fix numerous encoding issues. Fixes #1307. Fixes #1479 2016-07-26 15:05:14 +01:00
Dave Page 60659975ed Stop using deprecated imports. 2016-07-22 16:25:23 +01:00
Ashesh Vashi 8b35a60c08 Generate the proper unique name for the duplicate column name.
Thanks Murtuza for reporting the issue.
2016-07-19 11:27:03 +05:30
Harshal Dhumal 83a1535f89 Fix saving of query output as CSV data. Fixes #1405 2016-07-18 15:29:09 +01:00
Murtuza Zabuawala 5560d5b334 Properly support the interval type. Fixes #1437 2016-07-18 09:40:45 +01:00
Ashesh Vashi 9ba6bafb2b Using own version of cursor class to allow us to take care of the
duplicate name in column description.
2016-07-16 10:42:51 +05:30
Dave Page 7d0fe669ca Code tidy. 2016-06-21 14:21:06 +01:00
Dave Page 3026b470e9 Optimise Python imports. 2016-06-21 14:12:14 +01:00
Ashesh Vashi fc295f94a3 Remove recusive call of _wait_timeout() due to which python server is crashing 2016-06-16 17:49:02 +05:30
Murtuza Zabuawala a800b19c87 Fix display of NaN and Bytea data. Fixes #1350. Fixes #1309 2016-06-16 11:20:00 +01:00
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
Ashesh Vashi 7d08e42bbe During encryption password is converted to buffer (instead of
bytearray), and that is causing the issue in Python 2.

This was regress of commit-id: 37e2e1d24b
2016-06-07 13:26:43 +05:30
Ashesh Vashi 37e2e1d24b Fixing the decryption issue during restoring the connection on restart.
As we convert the binary password to string during storing the
connection information, we also need to convert it back to byte-arrays
during restoring the connections.

Hence - decode the passowrd using 'utf-8' encoding during storing the
connection information, and encode it during restoring the connections.
2016-06-06 22:48:53 +05:30
Ashesh Vashi ca62825c90 Set PGPASSWORD environment variable from the process executor before running
the external utility.
2016-05-15 22:29:17 +05:30
Harshal Dhumal 14839bf5de Always make sure - we convert the psasword to string in the as_dict
function.
2016-05-14 01:14:26 +05:30
Ashesh Vashi b22d73ec46 Improvise the pgsql driver to keep the utility names used for different
operation like backup, restore, etc within it.

Also:
* improvised the color combination of the background process logger.
* Removed an unnecessary print statement from the
  get_storage_directory(..) function, also return None if STORAGE_DIR
  is set to None.
2016-05-14 00:48:20 +05:30
Ashesh Vashi 7f790a7f49 Use the same cursor object of a connection object only from the same
server.

Current implementation keeps the cursor object in the 'g' (current
request context) object identified by the connection-id.
But - it fails to identify a different connection object request, when
we have same database name in different database server, it does not
able to identify it as separate request, Hence - now we will use
server-id qualified identifier for the same object.

Thanks Neel Patel for pointing out the issue.
2016-05-12 13:08:38 +05:30
Karen Blatchley 949e536bae First round of string review and cleanup. 2016-05-06 13:53:48 +01:00
Ashesh Vashi 26e9ceaf48 Do not reset the driver registry when the 'load_driver' method of
DriverRegistry is executed second time.

Also, initialize the driver before registering different blueprints,
which uses those driver inside them.

Thanks Khushboo for reporting the issue.
2016-04-25 15:33:54 +05:30