pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Re:  How to detach a database
3+ messages / 3 participants
[nested] [flat]

* Re:  How to detach a database
@ 2021-08-19 14:21  sivapostgres@yahoo.com <sivapostgres@yahoo.com>
  0 siblings, 1 reply; 3+ messages in thread

From: sivapostgres@yahoo.com @ 2021-08-19 14:21 UTC (permalink / raw)
  To: pgsql-general

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 AlwaysBKR Sivaprakash

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: How to detach a database
@ 2021-08-19 14:24  David G. Johnston <david.g.johnston@gmail.com>
  parent: sivapostgres@yahoo.com <sivapostgres@yahoo.com>
  0 siblings, 1 reply; 3+ messages in thread

From: David G. Johnston @ 2021-08-19 14:24 UTC (permalink / raw)
  To: sivapostgres@yahoo.com <sivapostgres@yahoo.com>; +Cc: pgsql-general

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.

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: How to detach a database
@ 2021-08-19 14:37  Tom Lane <tgl@sss.pgh.pa.us>
  parent: David G. Johnston <david.g.johnston@gmail.com>
  0 siblings, 0 replies; 3+ messages in thread

From: Tom Lane @ 2021-08-19 14:37 UTC (permalink / raw)
  To: David G. Johnston <david.g.johnston@gmail.com>; +Cc: sivapostgres@yahoo.com <sivapostgres@yahoo.com>; pgsql-general

"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





^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2021-08-19 14:37 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-08-19 14:21 Re:  How to detach a database sivapostgres@yahoo.com <sivapostgres@yahoo.com>
2021-08-19 14:24 ` David G. Johnston <david.g.johnston@gmail.com>
2021-08-19 14:37   ` Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox