Taking databases offline - Mailing list pgsql-hackers

From Mariusz Czu³ada
Subject Taking databases offline
Date
Msg-id 9th99h$es4$1@news.tpi.pl
Whole thread Raw
Responses Re: Taking databases offline
List 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




pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: beta3
Next
From: Bruce Momjian
Date:
Subject: Re: beta3