Thread

  1. DROP USER results in backend closure

    PostgreSQL Bugs List <pgsql-bugs@postgresql.org> — 2001-05-26T12:21:17Z

    J. Michael Caine (jmcaine@alum.rpi.edu) reports a bug with a severity of 2
    The lower the number the more severe it is.
    
    Short Description
    DROP USER results in backend closure
    
    Long Description
    Just switched to Debian distro and got postgresql set up.  (Actually, comes "out of the box" quite nice!)  As user 'postgres', I added a user, 'jmcaine', and made him a superuser.  Then I su'd to 'jmcaine', created a database (say, 'test2'), and su'd back to 'postgres'.  I used 'psql test' to open a client (note I did NOT open into 'test2', which was created by jmcaine -- 'test' was created by 'postgres').  I then attempted to 'DROP USER jmcaine'.  According to the doco, I expected it to tell me I wasn't allowed to drop a user while databases created by that user still existed.  Instead, I got booted off the client with the message:
    
    pqReadData() -- backend closed the channel unexpectedly.
            This probably means the backend terminated abnormally
            before or while processing the request.
    We have lost the connection to the backend, so further processing is impossible.  Terminating.
    
    As soon as I said 'DROP DATABASE test2', I was allowed to 'DROP USER jmcaine'.  But anytime before that I was kicked off as mentioned.  Note also that I used the (Linux - bash) shell to su between users, which were real system users, rather than '\connect'ing as different users.  I'm not sure if this makes a difference.
    
    Sample Code
    
    
    No file was uploaded with this report
    
    
    
  2. Re: DROP USER results in backend closure

    Tom Lane <tgl@sss.pgh.pa.us> — 2001-05-26T15:01:30Z

    pgsql-bugs@postgresql.org writes:
    > DROP USER results in backend closure
    
    I followed your procedure and got:
    
    regression=# DROP USER jmcaine;
    ERROR:  DROP USER: user "jmcaine" owns database "test2", cannot be removed
    
    AFAICT this has been the behavior at least since PG 7.0.
    
    How old is that Debian package?
    
    			regards, tom lane