This seems to be a longstanding issue (see https://github.com/hasura/hasura-cloud-preview-apps/issues/90) and I spent a little time triaging it. It seems that the way you were revoking access (by setting the datallowconn to false) isn't completely compatible with how AWS RDS (and possibly others) is set up. This changes the code to use ALTER DATABASE to set the connection limit to 0 which seems to work better. It also does this for both re-creating an environment and deleting one.
I've been using this for about a week in our app and it seems to be working much better this way. Not sure if I did the build/commits the way you want so feel free to just take the relevant change here in postgres.ts.
This seems to be a longstanding issue (see https://github.com/hasura/hasura-cloud-preview-apps/issues/90) and I spent a little time triaging it. It seems that the way you were revoking access (by setting the
datallowconn
to false) isn't completely compatible with how AWS RDS (and possibly others) is set up. This changes the code to useALTER DATABASE
to set the connection limit to 0 which seems to work better. It also does this for both re-creating an environment and deleting one.I've been using this for about a week in our app and it seems to be working much better this way. Not sure if I did the build/commits the way you want so feel free to just take the relevant change here in
postgres.ts
.