pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Gunnar \"Nick\" Bluth <gunnar.bluth.extern@elster.de>
To: pgsql-admin@postgresql.org
Subject: Re: New Column existing table + View
Date: Fri, 8 Jan 2016 10:16:51 +0100
Message-ID: <568F7E83.40002@elster.de> (raw)
In-Reply-To: <CAE_gQfX5E0Xh7xVdqH_AoX5OJuewsPkHwutkZ+OMZRDff00XPA@mail.gmail.com>
References: <CAE_gQfX5E0Xh7xVdqH_AoX5OJuewsPkHwutkZ+OMZRDff00XPA@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-admin>

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



view thread (2+ messages)

Message-ID: <568F7E83.40002@elster.de>
Permalink:  ../568F7E83.40002@elster.de/
Also on:    postgresql.org/message-id/568F7E83.40002@elster.de

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: gunnar.bluth.extern@elster.de
  Subject: Re: New Column existing table + View
  In-Reply-To: <568F7E83.40002@elster.de>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox