diff --git a/docs/en_US/release_notes_8_9.rst b/docs/en_US/release_notes_8_9.rst index 2ad031c87..b8359331c 100644 --- a/docs/en_US/release_notes_8_9.rst +++ b/docs/en_US/release_notes_8_9.rst @@ -34,10 +34,12 @@ Bug fixes | `Issue #7241 `_ - Fixed an issue where resizable data editors in query tool should not be allowed to resize beyond the app window bounds. | `Issue #7295 `_ - Fixed new line indentation in query editor and add a user preference to disable it. | `Issue #7306 `_ - Ensure that a user can connect to a server using SSL certificates and identity files from a shared storage. + | `Issue #7316 `_ - Fixed an issue where object explorer toolbar button not showing shortcut in the tooltip. | `Issue #7414 `_ - Add support for comments on RLS policy object. | `Issue #7476 `_ - Fixed an issue where changing a column name should reflect in all the constraints in table object dialog and ERD table dialog. | `Issue #7481 `_ - Fixed an issue where dark theme shows white background when all tabs are closed. | `Issue #7516 `_ - Ensure preferences can be loaded using preferences.json. + | `Issue #7523 `_ - Fixed an issue where the schema diff incorrectly marked tables as different due to schema-qualified trigger functions in the trigger definitions. | `Issue #7528 `_ - Fixed an issue where backslash breaks syntax highlighting. | `Issue #7536 `_ - Search Objects dialog should focus on search input on open. | `Issue #7542 `_ - Fixed incorrect sorting of size in statistics tab. diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/triggers/sql/pg/default/get_triggerfunctions.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/triggers/sql/pg/default/get_triggerfunctions.sql index 6b8383b4e..dd91f4849 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/triggers/sql/pg/default/get_triggerfunctions.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/triggers/sql/pg/default/get_triggerfunctions.sql @@ -1,4 +1,8 @@ +{% if without_schema %} +SELECT pg_catalog.quote_ident(proname) AS tfunctions +{% else %} SELECT pg_catalog.quote_ident(nspname) || '.' || pg_catalog.quote_ident(proname) AS tfunctions +{% endif %} FROM pg_catalog.pg_proc p, pg_catalog.pg_namespace n, pg_catalog.pg_language l WHERE p.pronamespace = n.oid AND p.prolang = l.oid diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/__init__.py index 49dfde1cb..3b992bd8e 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/__init__.py +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/__init__.py @@ -527,7 +527,7 @@ class TriggerView(PGChildNodeView, SchemaDiffObjectCompare): status=200 ) - def _fetch_properties(self, tid, trid): + def _fetch_properties(self, tid, trid, without_schema=False): """ This function is used to fetch the properties of the specified object :param tid: @@ -550,7 +550,8 @@ class TriggerView(PGChildNodeView, SchemaDiffObjectCompare): # Making copy of output for future use data = dict(res['rows'][0]) data = trigger_utils.get_trigger_function_and_columns( - self.conn, data, tid, self.blueprint.show_system_objects) + self.conn, data, tid, self.blueprint.show_system_objects, + without_schema) data = trigger_definition(data) @@ -1041,8 +1042,12 @@ class TriggerView(PGChildNodeView, SchemaDiffObjectCompare): current_app.logger.error(triggers) return False + without_schema = ( + SchemaDiffRegistry.get_schema_diff_compare_mode() == + 'Schema Objects') for row in triggers['rows']: - status, data = self._fetch_properties(tid, row['oid']) + status, data = self._fetch_properties(tid, row['oid'], + without_schema) if status: res[row['name']] = data diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/utils.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/utils.py index fb41dcdd2..8b131c3d6 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/utils.py +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/utils.py @@ -89,14 +89,15 @@ def get_column_details(conn, tid, clist, template_path=None): @get_template_path -def get_trigger_function_and_columns(conn, data, tid, - show_system_objects, template_path=None): +def get_trigger_function_and_columns(conn, data, tid, show_system_objects, + without_schema=False, template_path=None): """ This function will return trigger function with schema name. :param conn: Connection Object :param data: Data :param tid: Table ID :param show_system_objects: show system object + :param without_schema: without_schema :param template_path: Optional Template Path :return: """ @@ -106,7 +107,8 @@ def get_trigger_function_and_columns(conn, data, tid, SQL = render_template("/".join( [template_path, 'get_triggerfunctions.sql']), tgfoid=data['tgfoid'], - show_system_objects=show_system_objects + show_system_objects=show_system_objects, + without_schema=without_schema ) status, result = conn.execute_dict(SQL)