Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2011
    Location
    Brisbane, Australia
    Posts
    4

    Unanswered: delete user problem

    I have a user set up in a postgresql DB and am trying to delete the user and the db.
    When I use dropdb, I get the message "failed to delete, there are 6 sessions still using this DB".

    Does any one have any suggestions please?

  2. #2
    Join Date
    Nov 2006
    Posts
    82
    Disconnect all sessions first.

  3. #3
    Join Date
    Jun 2011
    Location
    Brisbane, Australia
    Posts
    4

    Disconnect all sessions first

    Thank you

    But how do I disconnect all of the sessions? please.

  4. #4
    Join Date
    Nov 2003
    Posts
    2,932
    Provided Answers: 12
    Quote Originally Posted by raykar View Post
    But how do I disconnect all of the sessions? please.
    The clean way is to shut down those applications that are establishing those connections.
    You can use the pg_stat_activity view (see http://www.postgresql.org/docs/curre...ing-stats.html) to find out what applications are connecting (and from where).

    If you want to do it the hard way, you can use pg_terminate_backend() to kill those sessions.
    For details see here: http://www.postgresql.org/docs/curre...N-SIGNAL-TABLE

Posting Permissions

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