function depend on view - Mailing list pgsql-general

From salah jubeh
Subject function depend on view
Date
Msg-id 1345464840.26018.YahooMailNeo@web122205.mail.ne1.yahoo.com
Whole thread Raw
Responses Re: function depend on view  (Andreas Kretschmer <akretschmer@spamfence.net>)
List 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 by date:

Previous
From: Johann Spies
Date:
Subject: Re: Visualize database schema
Next
From: Andreas Kretschmer
Date:
Subject: Re: function depend on view