Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 2013
    Posts
    1

    Thumbs up Unanswered: How to Disconnect All Active connections in postgreSQL 8.0 ?

    I need to Drop my Database from my application.But,if clients are connected to my database it shows exception.
    In postgreSQL 9.1 pg_terminate_backend(procid) is working fine.But,I need to done Same thing in postgreSQL 8.0

    Thank you in Advance.

  2. #2
    Join Date
    Nov 2003
    Posts
    2,935
    Provided Answers: 12
    Use kill on the commandline.

    See here: http://www.postgresql.org/docs/8.0/s...onitoring.html
    I will not read nor answer questions where the SQL code is messy and not formatted properly using [code] tags: http://www.dbforums.com/misc.php?do=bbcode#code

    Tips for good questions:

    http://tkyte.blogspot.de/2005/06/how...questions.html
    http://wiki.postgresql.org/wiki/SlowQueryQuestions
    http://catb.org/esr/faqs/smart-questions.html

  3. #3
    Join Date
    Mar 2012
    Posts
    6
    avoid using kill -9 procid.

    You can rather user

    SELECT pg_terminate_backend(process_id)
    FROM pg_stat_activity
    WHERE datname = 'dbname';

  4. #4
    Join Date
    Nov 2003
    Posts
    2,935
    Provided Answers: 12
    Quote Originally Posted by bhardwajrahul View Post
    You can rather use

    SELECT pg_terminate_backend
    Which is not available in Avinash502's outdated and un-supported version
    Last edited by shammat; 08-13-13 at 06:59.
    I will not read nor answer questions where the SQL code is messy and not formatted properly using [code] tags: http://www.dbforums.com/misc.php?do=bbcode#code

    Tips for good questions:

    http://tkyte.blogspot.de/2005/06/how...questions.html
    http://wiki.postgresql.org/wiki/SlowQueryQuestions
    http://catb.org/esr/faqs/smart-questions.html

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •