Search Postgresql Archives

Re: live metadata changes v8.3.4

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Sep 27, 2011 at 1:51 PM, Gauthier, Dave <dave.gauthier@xxxxxxxxx> wrote:

> How does one make a metadata change to a DB that's actively being used.
> Specifically, I want to drop a view, drop some columns from a table that's
> used in the view, recreate the view without those columns.

BEGIN TRANSACTION;

DROP VIEW someView ...;

ALTER TABLE DROP COLUMN someColumn1, DROP COLUMN someColumn2;

CREATE VIEW someView AS ...;

COMMIT; --Wait for pre-existing locks to complete and hope your client
app doesn't break.


-- 
Regards,
Richard Broersma Jr.

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux