Taking databases offline

From: Mariusz Czułada <manieq(at)wp(dot)pl>
To: "PGSQL hackers" <pgsql-hackers(at)postgresql(dot)org>
Subject: Taking databases offline
Date: 2001-11-22 07:22:57
Message-ID: 002e01c17326$848e6300$57624cd5@domek
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi!

Is it possible (and safe) to move database files to other location while
server is working? I had to move one to another volume/path and 'sym-linked'
it to old dir. But had to shutdown server first. So my question (and
suggestion) is to consider:

ALTER DATABASE <dbname> { OFFLINE [ { WAIT | IMMEDIATE }] | ONLINE };

Taking db offline with IMMEDIATE disconnects all sessions, with WAIT
option... waits for all sessions to disonnect, with no options - fails if
anyone is connected to database; then file system actions are allowed (like
in my case). After ALTER... ONLINE normal use of database is restored.

Waitng for comments,

Mariusz Czulada

Browse pgsql-hackers by date

  From Date Subject
Next Message Hannu Krosing 2001-11-22 08:59:50 Re: Further open item (Was: Status of 7.2)
Previous Message Mariusz Czuada 2001-11-22 07:17:20 Taking databases offline