pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
lock a database from new connections, without modifying pg_hba.conf
5+ messages / 5 participants
[nested] [flat]

* lock a database from new connections, without modifying pg_hba.conf
@ 2006-05-18 17:22  Marc G. Fournier <scrappy@postgresql.org>
  0 siblings, 2 replies; 5+ messages in thread

From: Marc G. Fournier @ 2006-05-18 17:22 UTC (permalink / raw)
  To: pgsql-admin


Is that possible?  I've checked the docs for 8.1, and am not finding 
anything, nor anything in contrib ...

the best I've been able to think of so far is to modify pg_hba.conf to not 
allow new connections for the duration of the operations I need to perform 
(drop and create a database) ...

----
Marc G. Fournier           Hub.Org Networking Services (http://www.hub.org)
Email: scrappy@hub.org           Yahoo!: yscrappy              ICQ: 7615664



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

* Re: lock a database from new connections, without modifying pg_hba.conf
@ 2006-05-18 20:27  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Marc G. Fournier <scrappy@postgresql.org>
  1 sibling, 1 reply; 5+ messages in thread

From: Tom Lane @ 2006-05-18 20:27 UTC (permalink / raw)
  To: Marc G. Fournier <scrappy@postgresql.org>; +Cc: pgsql-admin

"Marc G. Fournier" <scrappy@postgresql.org> writes:
> Is that possible?  I've checked the docs for 8.1, and am not finding 
> anything, nor anything in contrib ...

> the best I've been able to think of so far is to modify pg_hba.conf to not 
> allow new connections for the duration of the operations I need to perform 
> (drop and create a database) ...

Not sure I understand what you need.  DROP DATABASE already locks out
new connections.

			regards, tom lane



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

* Re: lock a database from new connections, without modifying
@ 2006-05-20 15:54  Ben K. <bkim@coe.tamu.edu>
  parent: Marc G. Fournier <scrappy@postgresql.org>
  1 sibling, 0 replies; 5+ messages in thread

From: Ben K. @ 2006-05-20 15:54 UTC (permalink / raw)
  To: Marc G. Fournier <scrappy@postgresql.org>; +Cc: pgsql-admin

> Is that possible?  I've checked the docs for 8.1, and am not finding anything, 
> nor anything in contrib ...
> the best I've been able to think of so far is to modify pg_hba.conf to not 
> allow new connections for the duration of the operations I need to perform 
> (drop and create a database) ...

Just in case ...

update pg_catalog.pg_database set datallowconn = false where datname = 
'...';

http://archives.postgresql.org/pgsql-docs/2004-11/msg00015.php
http://www.postgresql.org/docs/8.1/interactive/manage-ag-templatedbs.html


My twopence.

Ben K.
Developer
http://benix.tamu.edu



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

* Re: lock a database from new connections, without modifying pg_hba.conf
@ 2006-07-10 22:58  adey <adey11@gmail.com>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 5+ messages in thread

From: adey @ 2006-07-10 22:58 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Marc G. Fournier <scrappy@postgresql.org>; pgsql-admin

Can hba be manipulated in such a way to make Postgres "read only" to obtain
a complete and full backup please, and if so, how?

On 5/19/06, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>
> "Marc G. Fournier" <scrappy@postgresql.org> writes:
> > Is that possible?  I've checked the docs for 8.1, and am not finding
> > anything, nor anything in contrib ...
>
> > the best I've been able to think of so far is to modify pg_hba.conf to
> not
> > allow new connections for the duration of the operations I need to
> perform
> > (drop and create a database) ...
>
> Not sure I understand what you need.  DROP DATABASE already locks out
> new connections.
>
>                        regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: if posting/reading through Usenet, please send an appropriate
>       subscribe-nomail command to majordomo@postgresql.org so that your
>       message can get through to the mailing list cleanly
>

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

* Re: lock a database from new connections, without modifying pg_hba.conf
@ 2006-07-10 23:26  Joshua D. Drake <jd@commandprompt.com>
  parent: adey <adey11@gmail.com>
  0 siblings, 0 replies; 5+ messages in thread

From: Joshua D. Drake @ 2006-07-10 23:26 UTC (permalink / raw)
  To: pgsql-admin; +Cc: adey <adey11@gmail.com>; Tom Lane <tgl@sss.pgh.pa.us>; Marc G. Fournier <scrappy@postgresql.org>

On Monday 10 July 2006 15:58, adey wrote:
> Can hba be manipulated in such a way to make Postgres "read only" to obtain
> a complete and full backup please, and if so, how?

PostgreSQL allows "complete and full backups" while in production. E.g; we 
support hot backups :). You do not have to stop working just to run backups 
(unlike another unnamed database).

Sincerely,

Joshua D. Drake



>
> On 5/19/06, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> > "Marc G. Fournier" <scrappy@postgresql.org> writes:
> > > Is that possible?  I've checked the docs for 8.1, and am not finding
> > > anything, nor anything in contrib ...
> > >
> > > the best I've been able to think of so far is to modify pg_hba.conf to
> >
> > not
> >
> > > allow new connections for the duration of the operations I need to
> >
> > perform
> >
> > > (drop and create a database) ...
> >
> > Not sure I understand what you need.  DROP DATABASE already locks out
> > new connections.
> >
> >                        regards, tom lane
> >
> > ---------------------------(end of broadcast)---------------------------
> > TIP 1: if posting/reading through Usenet, please send an appropriate
> >       subscribe-nomail command to majordomo@postgresql.org so that your
> >       message can get through to the mailing list cleanly

-- 
   === The PostgreSQL Company: Command Prompt, Inc. ===
Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240
   Providing the most comprehensive  PostgreSQL solutions since 1997
             http://www.commandprompt.com/





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


end of thread, other threads:[~2006-07-10 23:26 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2006-05-18 17:22 lock a database from new connections, without modifying pg_hba.conf Marc G. Fournier <scrappy@postgresql.org>
2006-05-18 20:27 ` Tom Lane <tgl@sss.pgh.pa.us>
2006-07-10 22:58   ` adey <adey11@gmail.com>
2006-07-10 23:26     ` Joshua D. Drake <jd@commandprompt.com>
2006-05-20 15:54 ` Re: lock a database from new connections, without modifying Ben K. <bkim@coe.tamu.edu>

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