By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,871 Members | 2,575 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,871 IT Pros & Developers. It's quick & easy.

Automatic deleting views of table in PostgreSql

P: 6
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
Share this Question
Share on Google+
8 Replies


Expert 100+
P: 700
to be clear you want to delete views of a table when its (mean table) name changed?
Jul 14 '08 #2

P: 6
Yes, I want to delete views of a table when its name changed
Jul 14 '08 #3

Expert 100+
P: 700
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

P: 6
Thanks

I'll try to do it now

Dzięki:)
Jul 15 '08 #5

P: 6
Hi

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

Thanks
Jul 24 '08 #6

P: 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

Expert 100+
P: 700
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

P: 6
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

Post your reply

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