function depend on view

Поиск
Список
Период
Сортировка
От salah jubeh
Тема function depend on view
Дата
Msg-id 1345464840.26018.YahooMailNeo@web122205.mail.ne1.yahoo.com
обсуждение исходный текст
Ответы Re: function depend on view  (Andreas Kretschmer <akretschmer@spamfence.net>)
Список pgsql-general
Hello Guys,

I am having a scenario close to the one below, I have defined a function which depends on a view. I am able to drop the view, but my server did not complain about the dependency.

In the scenario  below, one can drop the views a2 and a1 respectively, and when executing a3(), certainly an exception will be raised. I think there should be an entry for this dependency in the pg_depend table with dependency type normal




CREATE TABLE a (
 id serial,
 name text
);

CREATE view a1 as select * FROM a;
CREATE view a2 as SELECT * FROM a1;

CREATE OR REPLACE FUNCTION a3 () RETURNS INTEGER AS
$$
select MAX (id) FROM a2;
$$
LANGUAGE 'sql';


DROP VIEW  a2;
DROP VIEW  a1;
SELECT * FROM a3();

Regards

В списке pgsql-general по дате отправления:

Предыдущее
От: Johann Spies
Дата:
Сообщение: Re: Visualize database schema
Следующее
От: Andreas Kretschmer
Дата:
Сообщение: Re: function depend on view