Re: [GENERAL] shutdown gracefully & single user mode? - Mailing list pgsql-general

From Moray McConnachie
Subject Re: [GENERAL] shutdown gracefully & single user mode?
Date
Msg-id 005f01beff4f$87d2c8f0$760e01a3@oucs.ox.ac.uk
Whole thread Raw
In response to shutdown gracefully & single user mode?  ("amy cheng" <amycq@hotmail.com>)
List pgsql-general
----- Original Message -----
From: Teodor Cimpoesu <teo@digiro.net>
Cc: <pgsql-general@postgreSQL.org>
Sent: Tuesday, September 14, 1999 5:11 PM
Subject: Re: [GENERAL] shutdown gracefully & single user mode?

I have not a lot of technical know-how on locking, but a couple of queries
present themselves from this...
Shouldn't step 0 be LOCK TABLE IN ACCESS EXCLUSIVE MODE ?
& what happens to the lock immediately after the table is dropped and before
it is recreated? At that stage if clients try to read from the table, should
they get denied access by the lock, or should they get an error saying no
such table?

> gee :)
> why don't you just :
> 0. LOCK TABLE IN EXCLUSIVE MODE
> 1. create a new table with the field adjusted to the needed size.
> 2. INSERT INTO new_table SELECT ... FROM old_table ...
> 3. DROP TABLE old_table
> 4. ALTER TABLE new_table RENAME TO old_table
> eventually within a transaction.
> Also a SELECT INTO may be a shortcut, but I didn't test that.


----------------------------------------------------------------------------
----------
Moray.McConnachie@computing-services.oxford.ac.uk



pgsql-general by date:

Previous
From: Nuchanach Klinjun
Date:
Subject: Re: [HACKERS] Permission problem with COPY FROM
Next
From: Gregoire Pichon
Date:
Subject: crypted field