473,395 Members | 1,745 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Automatic deleting views of table in PostgreSql

Hi

I have a problem with deleting all views od tables in PostgreSql.

I have the table with name "tab1" and it has a view with name "view1". Do you know how to dynamic delete all views when the name of the table "tab1" will be changed?

Sorry for my english

Thanks
Jul 14 '08 #1
8 3298
rski
700 Expert 512MB
to be clear you want to delete views of a table when its (mean table) name changed?
Jul 14 '08 #2
Yes, I want to delete views of a table when its name changed
Jul 14 '08 #3
rski
700 Expert 512MB
I didn't try it but there may be some solutions
1) with postgresql root privileges you can create trigger on pg_class wich will delete all views for a table which is altered (if i found comp with root accout on postgres i'll try do that and write it down here)
2) do alter on table and views removing via a some function, you should write.

Powinno zadziałać :)
Jul 14 '08 #4
Thanks

I'll try to do it now

Dzięki:)
Jul 15 '08 #5
Hi

Unfortunately I haven't done this problem yet :( I really need help

Thanks
Jul 24 '08 #6
Hi

I want to write some function in plpgsql which will be located into trigger later, this function must delete views of a table when its name was changed to another one (all views must be deleted)
Jul 25 '08 #7
rski
700 Expert 512MB
Hi

I want to write some function in plpgsql which will be located into trigger later, this function must delete views of a table when its name was changed to another one (all views must be deleted)
What about views which are defined on more than one table?
Jul 25 '08 #8
What about views which are defined on more than one table?

All views created on many tables must be deleted when tables are altered
Aug 3 '08 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Bruno BAGUETTE | last post by:
Hello, A friend told me that the views are not in the dump file produced by PostgreSQL 7.1. After looking in the archives, it seems that PostgreSQL 7.1 pg_dumpall had a bug that lost the...
10
by: Paulo Jan | last post by:
Hi all: Let's say I'm designing a database (Postgres 7.3) with a list of all email accounts in a certain server: CREATE TABLE emails ( clienteid INT4, direccion VARCHAR(512) PRIMARY KEY,...
2
by: Leif K-Brooks | last post by:
According to the Wikipedia article on PostgreSQL (http://en.wikipedia.org/wiki/PostgreSQL), it has a feature for automatic joins: "SELECT u.* FROM user u, address a WHERE a.city='New York' and...
3
by: sferriol | last post by:
hello is it possible with postgres 7.2 or more, to define a dynamic view. For example, i have a table with a column 'user' and i want to define a view which gives infomrations from different...
4
by: mike.griffin | last post by:
My name is Mike Griffin and we are adding PostgreSQL support to our product, MyGeneration. MyGeneration pulls meta-data from DBMS systems to generate business objects and stored procedures and...
2
by: Zak McGregor | last post by:
Hi all I have a table, for simplicity's sake containing one field, called unid. for example, select unid, oid from table gives me something like this: unid | oid ---------+---------
11
by: Olivier Guilyardi | last post by:
Hi, I'm trying to list views, eliminating internal ones from the output. Using 7.2, I found this simple statement : SELECT viewname FROM pg_views WHERE viewname !~ '^pg_'; It works fine,...
4
by: Sebastian Böck | last post by:
Hello all, i have a view defined as a simple select of a table. This table is inherited by a couple of others. All entries belong to the child-tables. I also have an unconditional update rule...
5
by: Daniel Wetzler | last post by:
Hi Sqlserver experts, I use the SQL Server enterprise manager of MSSQL 2000 regularly. I'm often annoyed by the automatic blanking of the table views. If this happens then mostly with the hint...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.