-
Notifications
You must be signed in to change notification settings - Fork 810
Add support of DEPENDS/NO DEPENDS ON EXTENSION for INDEX.#6388 #9357
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| ALTER INDEX public."Idx_$%{}[]()&*^!@""'`\/#" | ||
| NO DEPENDS ON EXTENSION postgres_fdw; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| -- Index: Idx_$%{}[]()&*^!@"'`\/# | ||
|
|
||
| -- DROP INDEX IF EXISTS public."Idx_$%{}[]()&*^!@""'`\/#"; | ||
|
|
||
| CREATE UNIQUE INDEX IF NOT EXISTS "Idx_$%{}[]()&*^!@""'`\/#" | ||
| ON public.test_table_for_indexes USING btree | ||
| (id ASC NULLS LAST, name COLLATE pg_catalog."POSIX" text_pattern_ops ASC NULLS LAST) | ||
| INCLUDE(name, id) | ||
| WITH (fillfactor=10, deduplicate_items=False) | ||
| TABLESPACE pg_default | ||
| WHERE id < 100; | ||
|
|
||
| ALTER INDEX public."Idx_$%{}[]()&*^!@""'`\/#" | ||
| DEPENDS ON EXTENSION plpgsql; | ||
|
Comment on lines
+13
to
+14
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Filename/content mismatch: file adds dependency instead of removing it. Similar to the 15_plus version, this filename suggests Either:
🤖 Prompt for AI Agents |
||
|
|
||
| COMMENT ON INDEX public."Idx_$%{}[]()&*^!@""'`\/#" | ||
| IS 'Test Comment'; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| CREATE UNIQUE INDEX "Idx_$%{}[]()&*^!@""'`\/#" | ||
| ON public.test_table_for_indexes USING btree | ||
| (id ASC NULLS LAST, name COLLATE pg_catalog."POSIX" text_pattern_ops ASC NULLS LAST) | ||
| INCLUDE(name, id) | ||
| WITH (fillfactor=10, deduplicate_items=False) | ||
| TABLESPACE pg_default | ||
| WHERE id < 100; | ||
|
|
||
| ALTER INDEX public."Idx_$%{}[]()&*^!@""'`\/#" | ||
| DEPENDS ON EXTENSION plpgsql; | ||
|
|
||
| ALTER INDEX public."Idx_$%{}[]()&*^!@""'`\/#" | ||
| DEPENDS ON EXTENSION postgres_fdw; | ||
|
|
||
| COMMENT ON INDEX public."Idx_$%{}[]()&*^!@""'`\/#" | ||
| IS 'Test Comment'; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| -- Index: Idx_$%{}[]()&*^!@"'`\/# | ||
|
|
||
| -- DROP INDEX IF EXISTS public."Idx_$%{}[]()&*^!@""'`\/#"; | ||
|
|
||
| CREATE UNIQUE INDEX IF NOT EXISTS "Idx_$%{}[]()&*^!@""'`\/#" | ||
| ON public.test_table_for_indexes USING btree | ||
| (id ASC NULLS LAST, name COLLATE pg_catalog."POSIX" text_pattern_ops ASC NULLS LAST) | ||
| INCLUDE(name, id) | ||
| WITH (fillfactor=10, deduplicate_items=False) | ||
| TABLESPACE pg_default | ||
| WHERE id < 100; | ||
|
|
||
| ALTER INDEX public."Idx_$%{}[]()&*^!@""'`\/#" | ||
| DEPENDS ON EXTENSION plpgsql; | ||
|
|
||
| ALTER INDEX public."Idx_$%{}[]()&*^!@""'`\/#" | ||
| DEPENDS ON EXTENSION postgres_fdw; | ||
|
|
||
| COMMENT ON INDEX public."Idx_$%{}[]()&*^!@""'`\/#" | ||
| IS 'Test Comment'; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| -- Index: Idx_$%{}[]()&*^!@"'`\/# | ||
|
|
||
| -- DROP INDEX IF EXISTS public."Idx_$%{}[]()&*^!@""'`\/#"; | ||
|
|
||
| CREATE UNIQUE INDEX IF NOT EXISTS "Idx_$%{}[]()&*^!@""'`\/#" | ||
| ON public.test_table_for_indexes USING btree | ||
| (id ASC NULLS LAST, name COLLATE pg_catalog."POSIX" text_pattern_ops ASC NULLS LAST) | ||
| INCLUDE(name, id) | ||
| NULLS NOT DISTINCT | ||
| WITH (fillfactor=10, deduplicate_items=False) | ||
| TABLESPACE pg_default | ||
| WHERE id < 100; | ||
|
|
||
| ALTER INDEX public."Idx_$%{}[]()&*^!@""'`\/#" | ||
| DEPENDS ON EXTENSION plpgsql; | ||
|
|
||
| COMMENT ON INDEX public."Idx_$%{}[]()&*^!@""'`\/#" | ||
| IS 'Test Comment'; | ||
|
Comment on lines
+1
to
+18
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chainVerify filename mismatch with test content. The filename suggests "no_depends" but the test actually includes an Please verify:
Run the following script to check if there are other test files that might clarify the intended test scenarios: 🏁 Script executed: #!/bin/bash
# Search for test files related to extension dependencies
fd -e sql -e msql . web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/tests/ | rg -i "depend|ext"Length of output: 810 Verify filename mismatch with test content. NO DEPENDS ON EXTENSION syntax was added in PostgreSQL 13, and it marks the index as no longer dependent on that extension if NO is specified. The filename This represents a mismatch. Either:
🤖 Prompt for AI Agents |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| CREATE UNIQUE INDEX "Idx_$%{}[]()&*^!@""'`\/#" | ||
| ON public.test_table_for_indexes USING btree | ||
| (id ASC NULLS LAST, name COLLATE pg_catalog."POSIX" text_pattern_ops ASC NULLS LAST) | ||
| INCLUDE(name, id) | ||
| NULLS NOT DISTINCT | ||
| WITH (fillfactor=10, deduplicate_items=False) | ||
| TABLESPACE pg_default | ||
| WHERE id < 100; | ||
|
|
||
| ALTER INDEX public."Idx_$%{}[]()&*^!@""'`\/#" | ||
| DEPENDS ON EXTENSION plpgsql; | ||
|
|
||
| ALTER INDEX public."Idx_$%{}[]()&*^!@""'`\/#" | ||
| DEPENDS ON EXTENSION postgres_fdw; | ||
|
|
||
| COMMENT ON INDEX public."Idx_$%{}[]()&*^!@""'`\/#" | ||
| IS 'Test Comment'; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| -- Index: Idx_$%{}[]()&*^!@"'`\/# | ||
|
|
||
| -- DROP INDEX IF EXISTS public."Idx_$%{}[]()&*^!@""'`\/#"; | ||
|
|
||
| CREATE UNIQUE INDEX IF NOT EXISTS "Idx_$%{}[]()&*^!@""'`\/#" | ||
| ON public.test_table_for_indexes USING btree | ||
| (id ASC NULLS LAST, name COLLATE pg_catalog."POSIX" text_pattern_ops ASC NULLS LAST) | ||
| INCLUDE(name, id) | ||
| NULLS NOT DISTINCT | ||
| WITH (fillfactor=10, deduplicate_items=False) | ||
| TABLESPACE pg_default | ||
| WHERE id < 100; | ||
|
|
||
| ALTER INDEX public."Idx_$%{}[]()&*^!@""'`\/#" | ||
| DEPENDS ON EXTENSION plpgsql; | ||
|
|
||
| ALTER INDEX public."Idx_$%{}[]()&*^!@""'`\/#" | ||
| DEPENDS ON EXTENSION postgres_fdw; | ||
|
|
||
| COMMENT ON INDEX public."Idx_$%{}[]()&*^!@""'`\/#" | ||
| IS 'Test Comment'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
Verify that the extension node is always registered.
The code assumes
pgBrowser.Nodes['extension']exists. If the extension node hasn't been registered,nodeExtObjwill be undefined, potentially causing issues ingetNodeAjaxOptionsat line 138.Run the following script to verify that the extension node is properly registered before this code executes:
🏁 Script executed:
Length of output: 828
🏁 Script executed:
Length of output: 417
🏁 Script executed:
Length of output: 0
🏁 Script executed:
Length of output: 0
🏁 Script executed:
Length of output: 39587
🏁 Script executed:
Length of output: 19448
🏁 Script executed:
Length of output: 2034
🏁 Script executed:
Length of output: 684
🏁 Script executed:
Length of output: 0
🏁 Script executed:
Length of output: 111
🏁 Script executed:
Length of output: 1308
🏁 Script executed:
Length of output: 3116
🏁 Script executed:
Length of output: 445
Add defensive null check for extension node before using it.
The code assumes
pgBrowser.Nodes['extension']is always defined, but both the extension and index modules are triggered on the same event with no documented ordering guarantee. While alphabetical directory structure may provide implicit safety, this lacks defensive programming.Add a null/undefined check at line 128 before passing
nodeExtObjtogetNodeAjaxOptions, or verify and document that the framework guarantees extension.js loads first.🤖 Prompt for AI Agents