Commit Graph

2651 Commits (master)

Author SHA1 Message Date
Pravesh Sharma 85290d4e61
Fixed an issue where the column order displayed was incorrect for exclusion constraints with multiple columns. #8430 2025-02-18 11:57:42 +05:30
Michal Charemza 83ade5dcc2
Update the query that fetches roles to be faster with many roles.
This changes the query that fetches roles from using the
pg_catalog.shobj_description function to using an explicit join on
pg_catalog.pg_shdescription. In my specific case, in a production system with
over 20k roles, this reduces the query time down from 8 minutes(!) down to
~40ms. Just in case it was a locking issue, I did use pg_activity to
investigate locks, and nothing was being blocked during the 8 minutes.

This fixes a problem that exists only for certain users, and specifically in my
case where the user that runs the query is themselves a member (directly and
indirectly) of a high number of roles. Running the existing query as a user
that has a low number of roles (and specifically, the master user in an AWS RDS
database), the existing query is fairly performant.

My best explanation as to the performance difference comes from the definition
of shobj_description
2a8a00674e/src/backend/catalog/system_functions.sql (L303-L312).
Each time it's called it runs a query against pg_shdescription and pg_class,
and so in my case runs 20k times, compared to the equivalent of once when doing
the explicit join on pg_shdescription. It should also be noted that in my case
pg_class is quite big - currently about 500k rows (although it has grown to ~5
million in the past, but that was borderline a mistake).

See https://github.com/pgadmin-org/pgadmin4/pull/8457#issue-2853052114 for
EXPLAIN ANALYZE results of the existing query and the updated query.
2025-02-17 17:20:28 +05:30
Akshay Joshi f63190dc93 Fixed an issue where pgAdmin does not support pg_vector column length/precision. #8181 2025-02-12 16:14:31 +05:30
Pravesh Sharma 2c37ff2893
Fixing following SonarQube Issues:
1. Ternary operators should not be nested.
2. "Exception" and "BaseException" should not be raised.
2025-02-11 12:03:43 +05:30
Aditya Toshniwal 650a15beec
Fixed an issue where the query tool was not treating IDENTITY columns as columns with default values when inserting new rows. #8341 2025-02-10 15:05:09 +05:30
Akshay Joshi bf7f8cdd73 1) Added missing GLOBALLY_DELIVERABLE config parameter in the config.py from the last commit.
2) Fixed API test cases for DBMS_JOB_SCHEDULER
2025-02-07 13:36:11 +05:30
Pravesh Sharma dd09986f71
Fixed an issue where quotes were missing in the CREATE script for the tablespace. #8408 2025-02-03 11:50:50 +05:30
Akshay Joshi d5101b7568 1) Disable PSQL Workspace in Server mode.
2) Fixed an issue where empty binary path throwing an error instead of proper error message.
2025-01-30 17:59:18 +05:30
Akshay Joshi 1317e5a921 Change the logic of setval function, so that the next nextval of sequence will return exactly the specified value. #3273 2025-01-28 17:52:21 +05:30
Akshay Joshi 22b7ae6cdc 1) Fixed an issue where loadingText message is not shown in SchemaView.
2) Fixed SonarQube Bugs and Code Smells.
2025-01-24 13:58:21 +05:30
Akshay Joshi 84a8a522e3
1) Fixed an issue where Default Privileges and Privileges not working correctly. #8369
2) Fixed <br/> tag visible issue.
2025-01-22 19:40:13 +05:30
Aditya Toshniwal 168aaa227a
Update the server list on welcome page when workspace is changed to get the latest server connection info. #7708 2025-01-20 18:45:51 +05:30
Akshay Joshi a410b15e30 Fixed an issue where <br/> tag is visible in the error message when delete any database and it is in use. 2025-01-17 17:16:36 +05:30
Akshay Joshi bf69b16f1f 1) Added the MAINTAIN privilege for PostgreSQL version 17 and above. #8332
2) Updated JavaScript Dependecies.
2025-01-14 14:18:07 +05:30
Rohit Bhati de6fbe7725
Fixed a button focus issue found while testing the dialog button changes. #6513 2025-01-08 17:22:11 +05:30
Yogesh Mahajan b9c7e7e9af
Remove the option "With no data (concurrently)" from Refresh MATERIALIZED VIEW context menu. #8309 2025-01-07 12:22:07 +05:30
Yogesh Mahajan 5dc52446f3
Fixed the issues reported while testing #8208 2025-01-02 15:47:25 +05:30
Akshay Joshi 964d211260 Copyright updated for 2025 2025-01-01 11:26:42 +05:30
Akshay Joshi 9cd8492ec1 Fixed an issue where Schema Diff not produce difference script for Index definition with where condition. #8072 2024-12-19 16:40:18 +05:30
Akshay Joshi 6df5d14a60 Fixed an issue where properties dialog throwing an error for Materialized View. #8209 2024-12-19 15:55:23 +05:30
Rohit Bhati 8af25ba0c1
Change button labels and color in delete confirmation dialog for all objects to improve UX. #6513 2024-12-18 17:25:36 +05:30
Akshay Joshi 185e0f61e2
Close the connection and delete adhoc server if all it's Query tool and PSQL connections are closed. 2024-12-17 17:57:25 +05:30
Yogesh Mahajan a0cd6c6a88
Allow deleting the entry while creating/adding new label to enumeration type. #8208 2024-12-16 14:54:24 +05:30
Akshay Joshi fe6e21a08b
Enhanced pgAdmin 4 with support for Workspace layouts. #7708 2024-12-16 14:52:56 +05:30
Aditya Toshniwal 60078c37a3 Add a new config MAX_SERVER_TAGS_ALLOWED to limit the number of tags on server node. #8192 2024-12-06 12:16:15 +05:30
Anil Sahoo e2c20b5022
Fixed an issue where a column name change in the edit dialog of the table node does not show the updated column name. #7892 2024-12-05 16:53:50 +05:30
Aditya Toshniwal bd2a484c2f
Added support for adding tags on a server node. #8192 2024-12-05 12:18:26 +05:30
Pravesh Sharma 5e8a75cdf9
Added escaping for the placeholder parameters before passing it to the passexec command. #6794 2024-12-04 15:42:45 +05:30
Pravesh Sharma 6810fa6ce6
Add support for passing connection details as placeholders in the passexec command. #6794
Added a fix where electron app menu was not refreshing when node selection changed.
2024-11-29 17:54:07 +05:30
Pravesh Sharma 4dbfdd8740
Added an EPAS 17 resql test case for builtin locale provider. #8095 2024-11-21 11:21:05 +05:30
Anil Sahoo 8be65ceb7b
Fixed an issue related to the query tool update connection after the server disconnected from the object explorer. #7865 2024-11-19 15:44:40 +05:30
Aditya Toshniwal 9a8d520abd Fix few issues found in menu rendering code and GUI test cases 2024-11-14 14:49:07 +05:30
Aditya Toshniwal 296befc881 Code refactoring at multiple places to improve re-usability 2024-11-14 14:16:38 +05:30
Aditya Toshniwal 00d3aaa1fd Refactor menu building code to support sub-menus of any depth 2024-11-14 13:36:42 +05:30
Pravesh Sharma 0aba9703cd
Added support for a builtin locale provider in the Database dialog. #8095 2024-11-14 13:20:01 +05:30
John (Haipeng) Jiang 040e988323
Schema Diff bug when comparing materialized views with indices: key 'indrelid' needs to be ignored. 2024-11-14 12:43:33 +05:30
Aditya Toshniwal 6fcc4ae6a2 More fixes for issues found while testing query tool pagination changes. #1780 2024-11-08 15:48:24 +05:30
Pravesh Sharma b51eef12b7
Add an object menu option to disconnect all server and database connections. #1984 2024-11-06 15:52:31 +05:30
Pravesh Sharma fa64e8b38f
Fixed an issue where role properties were not loading. #7837 2024-09-24 11:59:05 +05:30
Ashesh Vashi 1f53baee8f
Fixed the dynamic column updation in the Unique & Primary Keys while creating a table.
* Updated the columns for the unique and primary keys while creating a table.
Use the 'editable' option for a Cell instead of 'disabled'.

* Don't need to define the hidden member as fields in GridHeaderSchema

* Updated the columns for the exclusion constraints while creating a
 table.

* Signaled the relevant field, when column options have changed, for all
the children of a table.

* Use current snapshot of data for the GrigFormHeadeer

* Fixed the styling for the search input box

* Don't check for the 'colOptions.editable' flag, as it could be
indirect call as well.
2024-09-19 18:57:09 +05:30
Ashesh Vashi b0cd028ff8
Fixed an issue introduced due to reloading of the tree due to changes in particular preferences (#7942)
* Fix an issue - when the object browser tree is being recreated due to reloading for changes in some of the preferences. Tree object returns object from the previous instance as 'selected', but - it does not have the 'treeNodeInfo' available. In this special case - we would consider that there is no node selected at that particular moment, and pass information accordingly.

* Fixed 'New Connection' dialog issue after connecting a disconnected server.

* Disable the 'Add' button in the GridHeader with form, when 'canAdd'
flag is set to false.

* Convert the access path to string array for correct comparision.

* Check the access path type before comparison.
When language is 'c', set the 'code' block read-only.

* Enabled 'Strict' control for EPAS >= 95
2024-09-18 20:55:01 +05:30
Ashesh Vashi 441cc57bb8
Don't show 'Types of objects' for the 'Cluster' operation. Fixes #7884 2024-09-18 07:48:09 +05:30
Yogesh Mahajan dd6f6cf1af
Support OIDC in OAuth2 authentication. #7839 2024-09-16 08:36:54 +05:30
Ashesh Vashi 5e96f0fd61
Fixes the Variable Schema UI issues and InlineView bug reported in #7884
* Show the icon for the 'Reset' button. (Reference #7884)

* Reload the server list after connecting to a server in the 'New
connection' dialog (QueryTool). (Reference: #7884)

* Pass the grid path during the bulk update (click on a radio action)

* Don't assign the cell value to the 'rowValue' variable.

* Don't rely on the 'optionsLoaded' for setting the variable types as it
is loaded asynchronously, and variable types data may not be available
while rendering the 'value' cell. (Fixes #7884)

* Fixed a type while checking for the 'inline-group'. fixes (#7884)

* 'vnameOptions' can be a Promise function too, hence - taken care accrodingly.

* Introduced a parameter 'reloadOnDepChanges' in the BaseSchemaUI field
to force reload the control on value change for one of the
dependencies.

* Reload on the components in case of dependent value changes.

* Introduced 'useSchemaStateSubscriber', which generates a state
subscriber mananager instance. It helps multiple subscribers in a
single control as we could have multiple subscribe within a control.
(For example - value, options, errors, etc).

* Fixed all the issues reported (#7884)
2024-09-16 00:04:37 +05:30
Yogesh Mahajan d3d1eb3355
Fixed issue of migrating tunnel password with new master password mechanism. #7076 2024-09-09 17:38:22 +05:30
Ashesh Vashi e9af0c3226
Improved the extendability of the SchemaView and DataGridView. (#7876)
Restructured these modules for ease of maintenance and apply the single
responsibility principle (wherever applicable).

* SchemaView

 - Split the code based on the functionality and responsibility.
 - Introduced a new View 'InlineView' instead of using the
   'nextInline' configuration of the fields to have a better, and
   manageable view.
 - Using the separate class 'SchemaState' for managing the data and
   states of the SchemaView (separated from the 'useSchemaState'
   custom hook).
 - Introduced three new custom hooks 'useFieldValue',
   'useFieldOptions', 'useFieldError' for the individual control to
   use for each Schema Field.
 - Don't pass value as the parameter props, and let the
   'useFieldValue' and other custom hooks to decide, whether to
   rerender the control itself or the whole dialog/view. (single
   responsibility principle)
 - Introduced a new data store with a subscription facility.
 - Moving the field metadata (option) evaluation to a separate place
   for better management, and each option can be defined for a
   particular kind of field (for example - collection, row, cell,
   general, etc).
 - Allow to provide custom control for all kind of Schema field.

* DataGridView

 - Same as SchemaView, split the DataGridView call into smaller,
   manageable chunks. (For example - grid, row, mappedCell, etc).
 - Use context based approach for providing the row and table data
   instead of passing them as parameters to every component
   separately.
 - Have a facility to extend this feature separately in future.
   (for example - selectable cell, column grouping, etc.)
 - Separated the features like deletable, editable, reorder,
   expandable etc. cells using the above feature support.
 - Added ability to provide the CustomHeader, and CustomRow through the
   Schema field, which will extend the ability to customize better.
 - Removed the 'DataGridViewWithHeaderForm' as it has been achieved
   through providing 'CustomHeader', and also introduced
   'DataGridFormHeader' (a custom header) to achieve the same feature
   as 'DataGridViewWithHeaderForm'.
2024-09-09 14:27:31 +05:30
Yogesh Mahajan 306269af5d
Fix issues found while testing keyring changes. #7076 2024-09-02 19:32:25 +05:30
Anil Sahoo 8bae604129
Fix the query tool restore connection issue on the server disconnection from the left side object explorer. #6502 2024-09-02 15:06:11 +05:30
Pravesh Sharma 445e89576b
Fixed an issue where users could not use pgAdmin if they did not have access to the management database. #7571 2024-08-30 12:13:47 +05:30
Yogesh Mahajan c4dc839d7c
Fix issue found while testing keyring related changes. #7076 2024-08-28 11:46:04 +05:30
Yogesh Mahajan 1257ec9969
Revamp the current password saving implementation to keyring and reducing repeated OS user password prompts. #7076
The new implementation will store the master password in the keyring instead of storing each and every server password separately. The master password will be used to encrypt/decrypt server password when storing in the pgAdmin config DB.
2024-08-22 16:44:57 +05:30
Ashesh Vashi 8cf316b853
Fixed some of the issues reported due to introduction of the custom hook 'useSchemaState'. #7776 2024-08-19 09:53:00 +05:30
Rohit Bhati 81d8ea56f8
Fix server heartbeat logging error after deleting the server. #7540 2024-08-07 14:32:48 +05:30
Rohit Bhati 5d7ec14076
Fixed delete object(shortcut key) affecting both text and Object Explorer items. #7683 2024-08-01 11:48:16 +05:30
Pravesh Sharma 2e878a3fb2
Fixed an issue where the REVOKE statement in the create script was throwing an error if the role contained special characters. #7737 2024-08-01 11:34:00 +05:30
Rohit Bhati 19237fe247
Fixed an issue where delete object(shortcut key) affecting both text and Object Explorer items. #7683 2024-07-31 11:25:08 +05:30
Aditya Toshniwal 026292f07b Fix tab focus issue when closing query tool using keyboard shortcut. #6572 2024-07-23 17:02:39 +05:30
Rohit Bhati b173fda116
Fix tab focus issue while deleting multiple tabs using shortcut key. #6572 2024-07-22 11:32:26 +05:30
Rohit Bhati 8030bc708b
Add support for highlighting selection matches in the query editor. #7530 2024-07-18 17:51:20 +05:30
Rohit Bhati 9ee896aac4
Add a keyboard shortcut to close active tab panel. #6572 2024-07-17 18:19:36 +05:30
Yogesh Mahajan e028ebc152
Ensure pgadmin does not try to connect to the server if saved password is not available. #7679 2024-07-16 17:46:40 +05:30
Anil Sahoo 30051f3257
Fixed an issue where Reassign/Drop Owned dialog not opening for Role. #7663 2024-07-16 17:42:16 +05:30
Aditya Toshniwal 760e38293c Fix issues found during Electron testing. #7494
Fix application crash when using users dialog. #7607
2024-07-08 19:24:29 +05:30
Aditya Toshniwal dcfef154ce
- Set the browser target to ES6 and reduce the JS bundle size considerably
- Upgrade ESLint to v9.x and migrate the .eslintrc.js file to make it work
2024-07-04 18:25:47 +05:30
Khushboo Vashi 4f415f9768
Added support for viewing PostgreSQL Server Logs in Text, CSV and JSON formats. #3981 2024-07-03 16:17:29 +05:30
Akshay Joshi 576dc55615
Fixed the permission denied issue for functions of the pgstattuple extension when accessing statistics with a non-admin user. #7035 2024-07-02 11:47:43 +05:30
Aditya Toshniwal f8fa1cf6d6
- Fix few SonarQube issues.
- Cleanup NW.js related stuff.
2024-07-02 10:34:30 +05:30
Aditya Toshniwal 3bb9f0ba8c
Remove support for Python 3.7 as Debian 10 is EOL. 2024-07-01 12:39:12 +05:30
Aditya Toshniwal 91eb60a363
Replace pgAdmin NW.js container with Electron container. #7494 2024-07-01 11:27:42 +05:30
Pravesh Sharma 4457a6a6a1
Updated to the latest version of the Notistack library. #7501 2024-07-01 11:26:45 +05:30
Akshay Joshi 3be2221948 Ensure that pgAdmin 4 is compatible with PostgreSQL v17. #7537 2024-06-27 13:18:26 +05:30
Akshay Joshi 3e7a220225 Fixed an issue where the schema diff incorrectly marked tables as different due to schema-qualified trigger functions in the trigger definitions. #7523 2024-06-20 16:55:38 +05:30
Aditya Toshniwal 9026f46220 Fixed an issue where object explorer toolbar button not showing shortcut in the tooltip.#7316 2024-06-20 11:31:11 +05:30
Yogesh Mahajan 95ffd1b9a1
More fixes for issues reported while testing changes related to makeStyle JSS changes and auto-theme. #7363 2024-06-19 11:54:18 +05:30
Akshay Joshi 0452828cc7 1) Change the cursor to a pointer for JSON editor toolbar buttons.
2) Remove the extra scrollbar in JSON editor.
3) Set the focus on the PSQL tool.
2024-06-18 16:42:17 +05:30
Akshay Joshi 2b04f3ca1d Fixed incorrect handling of the code smell for the reject API call 2024-06-17 18:22:38 +05:30
Rohit Bhati 1ba9f005a7
Ensure that user should be able to clear comments in RLS Policy. 2024-06-17 18:11:57 +05:30
Yogesh Mahajan b0e7847962
Fixed bugs found while testing makeStyles JSS changes. #7363 2024-06-17 15:45:40 +05:30
Anil Sahoo a946c70869
Fixed an issue where changing a column name should reflect in all the constraints in table object dialog and ERD table dialog. #7476 2024-06-17 14:07:45 +05:30
Akshay Joshi 5866da8194 Fixed SonarQube code smells. 2024-06-13 18:48:02 +05:30
Akshay Joshi ab01dde2ba Fixed RESQL test case. 2024-06-12 18:46:12 +05:30
Akshay Joshi dea5335ce5 Fixed the following SonarQube code smells:
1) Do not use the Array index in keys.
2) Import from the same module should be merged.
3) Mutable variables should not be exported.
4) Variables should not be initialized to undefined.
5) startswith or endswith method should be used.
6) Unwrap this unnecessarily grouped subpattern.

Additionally, addressed many other SonarQube rules.
2024-06-12 18:09:06 +05:30
Rohit Bhati 288fd7ed12
Add support for comments on RLS policy object. #7414 2024-06-12 17:18:55 +05:30
Aditya Toshniwal 056aff4742 Revert the changes done for removing support for Python 3.7 2024-06-12 16:23:27 +05:30
Akshay Joshi df2f3460f0 Fix the following SonarQube code smells:
1) Use the "RegExp.exec()" method instead.
2) Remove parameter form or provide default value.
3) Extract this nested ternary operation into an independent statement.
4) Replace this character class by the character itself.
5) Unnecessary use of conditional expression for default assignment.
6) Prefer using an optional chain expression instead, as it's more concise and easier to read.
2024-06-11 18:07:22 +05:30
Yogesh Mahajan fff192eb95
Ensure that a user can connect to a server using SSL certificates and identity files from a shared storage. #7306 2024-06-11 14:48:11 +05:30
Akshay Joshi 8857f0d179 Fix SonarQube code smells:
1) String literals should not be duplicated.
2) Prefer using an optional chain expression instead, as it's more concise and easier to read.
3) Expected the Promise rejection reason to be an Error.
2024-06-10 18:04:32 +05:30
Aditya Toshniwal de712b0805 - Update JS packages.
- Remove support for Python 3.7 as Debian 10 is EOL.
2024-06-07 14:17:22 +05:30
Aditya Toshniwal b1f70b02ff Update object explorer icons for EPAS and replication related nodes 2024-05-27 12:29:38 +05:30
Pravesh Sharma 36a71dc7fa
1. Fixed an issue where resetting the password from the password reset link was not working. #7500
2. Fixed an issue where the recover password button was enabled even when no email id was provided. #7487
2024-05-24 13:18:05 +05:30
Ahmad 5c30695d66
Fixed Typos 2024-05-23 12:52:41 +05:30
Akshay Joshi 6c7bc1c815 Ensure that Schema Diff does not indicate a table as different when the trigger names are the same but the trigger function body is different. #5762 2024-05-21 16:04:25 +05:30
Aditya Toshniwal dd45f06d50
Added support for viewing PGD Clusters. #7215 2024-05-20 16:54:49 +05:30
Pravesh Sharma 1c44cfb714
Update the documentation for preferences dialog and keyboard shortcuts. #7349, #7458 2024-05-15 15:21:23 +05:30
Pravesh Sharma afc28d95cf
1. Disable ERD for system Catalogs. #5849
2. Disable Debugger for system catalogs. #6060
3. Fixed an issue where the keyboard shortcut for launching the debugger from Object Explorer was not working.
2024-05-08 15:29:01 +05:30
Aditya Toshniwal 5ec6faff13
Upgrade react-table from v7 to v8. #7419 2024-05-07 16:31:04 +05:30
RohitBhati8269 3e6bd29198
Enhance the Delete dialog by highlighting the names of the objects to be deleted in bold. #7411 2024-05-07 11:56:50 +05:30
Khushboo Vashi f4761f55f7 Fixed Multi-Factor Authentication bypass vulnerability (CVE-2024-4215). #7425 2024-04-29 13:41:02 +05:30
Pravesh Sharma 7c6fdcb12e
Disabled auto-fill on password fields. #2410 2024-04-29 11:44:17 +05:30
Akshay Joshi f724578463 Fixed API test cases for exec/call procedure. 2024-04-26 13:01:35 +05:30