Menu

#480 Disconnect Pooled Connections when Role Dropped

1.1 Dev Q
open
nobody
5
2014-08-27
2014-02-20
No

I created a user:

createuser -U postgres foo

Then tried to create a database:

createdb -U foo foo
createdb: database creation failed: ERROR:  permission denied to create database

Oh yeah, I forgot to make a super user. Do I drop it and create it again:

dropuser -U postgres foo
createuser -U postgres -s foo

Now I can create a database, right? Not so much:

createdb -U foo foo
createdb: database creation failed: ERROR:  permission denied to create database
CONTEXT:  Error message received from nodes: coordinator#2 coordinator#3 coordinator#4

Took me a while to realize that there were connections still around with the first "foo" user. I wiped them out:

psql -U postgres -c 'CLEAN CONNECTION TO ALL TO USER foo'
CLEAN CONNECTION

And now I can create a database, right? Right:

createdb -U foo foo

So I think that when a user or role is dropped, any connections for that user should automatically be removed from the pool.

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.