Skip site navigation (1) Skip section navigation (2)

is there a 'replace' for tables/views?

From: Michael Enke <michael(dot)enke(at)wincor-nixdorf(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Subject: is there a 'replace' for tables/views?
Date: 2010-09-28 15:05:18
Message-ID: 4CA2042E.8060703@wincor-nixdorf.com (view raw or flat)
Thread:
Lists: pgsql-general
Hello group,

is there a functionality like 'create or REPLACE table/view'
to circumvent drop with 'cascade' and recreation of depending objects?

I have a table schema1.x (col1, col2)
and a view schema1.v -> schema1.x(col1)

Another table is schema2.x(col1, col2) with same structure as x in schema1.

I have to drop the table schema1.x and create a view with same name:
schema1.x (view) -> schema2.x (table)

The drop will work only with "cascade", and after creation of view schema1.x
I have to recreate the view schema1.v -> schema1.x(col1)

If there is no way today, would it be a good idea for a future release? ;-)

Michael

WINCOR NIXDORF International GmbH
Sitz der Gesellschaft: Paderborn
Registergericht Paderborn HRB 3507
Geschäftsführer: Eckard Heidloff (Vorsitzender), Stefan Auerbach, Dr. Jürgen Wunram
Vorsitzender des Aufsichtsrats: Karl-Heinz Stiller
Steuernummer: 339/5884/0020 - Ust-ID Nr.: DE812927716 - WEEE-Reg.-Nr. DE44477193

Diese E-Mail enthält vertrauliche Informationen.
Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben,
informieren Sie bitte sofort den Absender und vernichten Sie diese E-Mail.
Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser E-Mail ist nicht gestattet.

This e-mail may contain confidential information.
If you are not the intended recipient (or have received this e-mail in error)
please notify the sender immediately and destroy this e-mail.
Any unauthorised copying, disclosure or distribution of the material in this e-mail is strictly forbidden.

pgsql-general by date

Next:From: paoloDate: 2010-09-28 15:52:44
Subject: Re: Visualize GiST Index
Previous:From: David FetterDate: 2010-09-28 14:26:29
Subject: Re: Implicit CAST is not working in Postgresql 8.4

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group