Re: lock entire database

From: Ron St-Pierre <rstpierre(at)syscor(dot)com>
To: Benjamin <benjamin(at)netyantra(dot)com>, pgsql-novice <pgsql-novice(at)postgresql(dot)org>
Subject: Re: lock entire database
Date: 2004-08-06 18:19:23
Message-ID: 4113CBAB.2020904@syscor.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Benjamin wrote:

>
> Thanx Ron for that.
> I got the listing of the tables.
> The \d option gives u a formatter output. I just wanted a list , that
> i cud loop on.
> I guess that cud be done with a simple "SELECT tablename from
> pg_tables where schemaname='public' ".
>
> Now to the need to lock the database. I need to backup the database at
> run-time, on another machine, which is a backup for the first one. So
> the data has to match exactly as on the first. So till the backup
> faithfuly copies everything down, there shud be no changes on the main
> machine.
>
Postgres uses MVCC (multiversion concurrency control) which basically
means that each transaction takes a snapshot of the database when a user
performs a query (read, update, whatever). So if a pg_dump of the entire
database occurs within a single transaction, this would ensure that you
have a valid snapshot at one particular instance. *Can anyone verify if
this is indeed true*?

If that is true then a pg_dump should solve your problem.

Ron

ps pls post your responses to the list too.

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Scott Marlowe 2004-08-06 18:34:02 Re: Tables in one disk and indexes in another ??
Previous Message Gaetano Mendola 2004-08-06 18:14:10 Re: Tables in one disk and indexes in another ??