[go: nahoru, domu]

Skip to content
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

Query Tool: overwrites what I'm typing with unwanted SQL on slow connections #6357

Closed
vladr opened this issue Jun 2, 2023 · 2 comments
Closed
Assignees
Milestone

Comments

@vladr
Copy link
vladr commented Jun 2, 2023

Describe the bug

"Query Tool" has the following misfeature (using default settings): soon after opening, but not immediately after opening, the "Query" edit area is overwritten with the generic SQL for dropping/(re)creating whatever is currently focused in "Object Explorer".

  1. As a user, I don't care about said generic SQL; if I wanted it (which I don't), I can always right-click on the table and go to Scripts > CREATE Script.
    If I opened "Query Tool", it is because I want to run my own SQL, not some random unsolicited default, thank you very much!
    UPDATE: it looks like this behavior might be controlled by the (poorly named?) "Copy SQL from main window to query tool?" option (FWIW, I've never seen a "Main window" with any SQL in it, so I saw no reason to disable the option until I started experimenting some more for this bug report);
  2. To add insult to injury, when the generic SQL is inserted, it is inserted as late as several seconds after the tool actually opens (depending on network latency and server load), overwriting whatever I might have already typed there in the brief interval. #$%&!

To Reproduce

Steps to reproduce the behavior:

  1. UPDATE: Make sure "Copy SQL from main window to query tool?" is set in the "Query Tool" options (this is the default);
  2. Select an object (table, schema, ...) in the "Object Explorer" view;
  3. Click on "Query Tool" button in toolbar;
  4. Start typing your query right away;
    N.B. this step is timing-sensitive and may be best reproduced using a non-local (slow-ish) PG connection;
  5. Observe your query being overwritten with someone's idea of a sensible default that the user never actually asked for.

Expected behavior

If something has already been typed by the time the query that computes the CREATE script comes back, then what has already been typed should be left alone (and the CREATE script thrown away in the trash where it belongs).

(and/or)

Rename "Copy SQL from main window to query tool?" or its uselessly redundant description ("Specifies whether or not to copy SQL to query tool from main window.") to something that corresponds to what's actually going on, so people who want to disable the behavior realize that this is perhaps the option that controls it.

Error message

n/a

Screenshots

If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: macOS-12.6.4-x86_64-i386-64bit
  • Version: 7.2
  • Mode: Desktop
  • Browser (if running in server mode): n/a
  • Package type: DMG

Additional context

A few years back pgAdmin III used to be a really good and usable tool. Now, some areas (esp. around "Query Tool") are borderline unusable, with useful features that used to be there (such as being able to freely edit the SELECT query generated after picking "View First ZZZ Rows") gone. Sigh.

@vladr vladr added the Bug label Jun 2, 2023
@adityatoshniwal
Copy link
Contributor

We should disable the input till the script it loaded.

@pravesh-sharma
Copy link
Contributor

Issue fixed. Verified on snapshot build.

Env:
Mode - Desktop
OS - macOS Sonoma 14.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants