Giter Site home page Giter Site logo

Comments (5)

adityatoshniwal avatar adityatoshniwal commented on September 10, 2024

@Splarv Can you please share PostgreSQL docs link to pg_cancel_query? I failed to find it - https://www.postgresql.org/search/?q=pg_cancel_query

from pgadmin4.

Splarv avatar Splarv commented on September 10, 2024

@Splarv Can you please share PostgreSQL docs link to pg_cancel_query? I failed to find it - https://www.postgresql.org/search/?q=pg_cancel_query

Yep, my mistype.
https://www.postgresql.org/docs/current/functions-admin.html#FUNCTIONS-ADMIN-SIGNAL

pg_cancel_backend ( pid integer ) → boolean
Cancels the current query of the session

Btw, you can cancel query from the same connection, just like psql do it.
https://www.postgresql.org/docs/current/libpq-cancel.html
PQcancel
Requests that the server abandon processing of the current command.

from pgadmin4.

adityatoshniwal avatar adityatoshniwal commented on September 10, 2024

@Splarv Can you please share PostgreSQL docs link to pg_cancel_query? I failed to find it - https://www.postgresql.org/search/?q=pg_cancel_query

Yep, my mistype. https://www.postgresql.org/docs/current/functions-admin.html#FUNCTIONS-ADMIN-SIGNAL

pg_cancel_backend ( pid integer ) → boolean Cancels the current query of the session

Btw, you can cancel query from the same connection, just like psql do it. https://www.postgresql.org/docs/current/libpq-cancel.html PQcancel Requests that the server abandon processing of the current command.

Hi @Splarv,

pgAdmin is already using pg_cancel_backend - https://github.com/pgadmin-org/pgadmin4/blob/master/web/pgadmin/dashboard/__init__.py#L657

from pgadmin4.

Splarv avatar Splarv commented on September 10, 2024

Sure, thats why the bug is. Look what did happen, I use role A to login and B to set role after login. To cancel query you send pg_cancel_backend from the other connection by the same user, but the effective user to execute pg_cancel_backend must be not B for this purpose, but A. The error raised because you use user B for this purpose and query doesn't canceled. This is a bug.

from pgadmin4.

adityatoshniwal avatar adityatoshniwal commented on September 10, 2024

Hi @Splarv,
The connection made using the details from server dialog is used everywhere. pgAdmin cannot create a connection separately without the role specified and execute pg_cancel_backend.
This is not a bug.
This behaviour is same as psql.

Thanks.

from pgadmin4.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.