Thread: Re: How to detach a database
Hello,
We want to carry out some data manipulation work in a database exclusively. We don't want any one to connect this database during that time. How to do it ?
In SQL Server there are two ways [ earlier we used SQL Server and now switched to PG ]
1. Change the database to work in single-user mode.
2. Detach the database from that server, copy to another server, do the required changes, copy back to original server and attach it.
Yes, we do carry out this in the production database also, where we used to ask the users not to use the application.
Is there any way to make a PG database either in-active or switch to single-user mode ? We want to avoid DELETE database process.
Happiness Always
BKR Sivaprakash
On Thursday, August 19, 2021, sivapostgres@yahoo.com <sivapostgres@yahoo.com> wrote:
Is there any way to make a PG database either in-active or switch to single-user mode ? We want to avoid DELETE database process.
Probably can do it via changing the pg_hba.conf file.
David J.
"David G. Johnston" <david.g.johnston@gmail.com> writes: > On Thursday, August 19, 2021, sivapostgres@yahoo.com <sivapostgres@yahoo.com> > wrote: >> Is there any way to make a PG database either in-active or switch to >> single-user mode ? We want to avoid DELETE database process. > Probably can do it via changing the pg_hba.conf file. Either that or revoke public CONNECT privilege on the database. regards, tom lane