Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6097763
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T13:04:52+00:00 2026-05-23T13:04:52+00:00

I search for a way to control the session timeout of the PGSQL (9.0)

  • 0

I search for a way to control the session timeout of the PGSQL (9.0) client (Windows).

When a Session dying? What happened with them after die.

How can I force a Session to die? (For example it is “locked”, on some wrong long query, and I want to force the server to release the resources).

Thanks for it:
dd


I extend this to understand it:
The databases need to know which session is dead.
Dead session must be released, because it is only hold the resources, and if this operation not finished, many locks we should get, or we can out of available connections (reach the maximum).

Other DataBases (FireBird, EDB) defines a TimeOut parameter for it.

When it reached, the session set to dead, and user connection aborted.

To avoid exhausting you need to periodically do something, that extend the period.

Theres is 3 ways to reach the timeout:
1.) the client program hangs, or freezed, or closed.
2.) the network connection broken
3.) the client send some very long query/stored procedure that don’t finish.

If the timeout not handled by server, may somebody’s transaction, lock, etc still alive for X hours, and you have to only one way to remove it: restart the db server service.

Other databases handle dead sessions as they no more interact to the server, so the client got some error, it need to restart the client software.

Some databases supports the return to the “inactive” but “not dead” session, and they can continue the work.

So, with this preface I ask my question again:

  1. How can I control the client’s session timeout under pgsql? System variable, SQL parameter, etc?
  2. How can I extend this time?
  3. What happens if a long query is exhausting the period?
  4. When does the pgsql server release the resources held by the client ?

Thanks:
dd

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T13:04:52+00:00Added an answer on May 23, 2026 at 1:04 pm

    I don’t understand the first part of your question, but to kill a running session you can use pg_terminate_backend()

    To kill the query of a running session use pg_cancel_query()

    Both functions are explained in the manual:

    http://www.postgresql.org/docs/current/static/functions-admin.html#FUNCTIONS-ADMIN-SIGNAL-TABLE

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is search and replace the only way to rename as asp control in the
In the UISearchBar control, is the a way to change the Search key title
Is there a way to search for multiple strings simultaneously in Vim? I recall
I am looking for a way to search through every users profile using the
What is the best way to search strings for something like forum? i seen
I'm looking for a way to search through our subversion repository or just packaged
Is there a reasonable way to search standards for programming and markup languages (specifically,
Is there a way to search for a file in a subversion repository? Something
Is there a way to search and eventually search and replace text in Visual
Is there a way to search, from a string, a line containing another string

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.