Search Postgresql Archives

function depend on view

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux