Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1aHTAI-0005Dx-VU for pgsql-admin@arkaria.postgresql.org; Fri, 08 Jan 2016 09:16:59 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1aHTAI-0003cR-9a for pgsql-admin@arkaria.postgresql.org; Fri, 08 Jan 2016 09:16:58 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1aHTAH-0003cK-RQ for pgsql-admin@postgresql.org; Fri, 08 Jan 2016 09:16:57 +0000 Received: from edmmai01.een.elster.de ([217.237.175.34] helo=elster.de) by magus.postgresql.org with esmtp (Exim 4.84) (envelope-from ) id 1aHTAE-0004Sr-0O for pgsql-admin@postgresql.org; Fri, 08 Jan 2016 09:16:57 +0000 X-AuthUser: gunnar.bluth.extern@elster.de Received: from [10.200.128.23] ([192.168.90.2]:48499) by elster.de with [XMail 1.27 ESMTP Server] id for from ; Fri, 8 Jan 2016 10:16:52 +0100 Subject: Re: New Column existing table + View To: pgsql-admin@postgresql.org References: From: "Gunnar \"Nick\" Bluth" Message-ID: <568F7E83.40002@elster.de> Date: Fri, 8 Jan 2016 10:16:51 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -4.2 (----) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-admin Precedence: bulk Sender: pgsql-admin-owner@postgresql.org Am 07.01.2016 um 23:43 schrieb drum.lucas@gmail.com: > Hi all! > > Question 1: > > I want to add a new column to a base table, and add that new column to > an existing view... > > So all selects/updates/deletes translate back to the original table > > How can I do that? 1a) ALTER TABLE 1b) CREATE OR REPLACE VIEW (assuming you have your initial CREATE VIEW statement still around, just add the additional column and add the "OR REPLACE") 1c) See http://michael.otacoo.com/postgresql-2/postgres-9-3-feature-highlight-auto-updatable-views/ if that fits your needs. Cheers, -- Gunnar "Nick" Bluth DBA ELSTER Tel: +49 911/991-4665 Mobil: +49 172/8853339 -- Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-admin