Re: function depend on view - Mailing list pgsql-general

From Merlin Moncure
Subject Re: function depend on view
Date
Msg-id CAHyXU0wxCtXrGvZa4etLHmFC5onQnLmM+SPdWEiK8=g7AD23Bw@mail.gmail.com
Whole thread Raw
In response to Re: function depend on view  (salah jubeh <s_jubeh@yahoo.com>)
List pgsql-general
On Mon, Aug 20, 2012 at 9:37 AM, salah jubeh <s_jubeh@yahoo.com> wrote:
> Hello Andreas,
>
> Thanks for the reply,  The example I have posted is very simple and you are
> right it is very similar to select max (id) from table_that_does_not_exist;
> But there are more here, for example imagine I have something like
>
> CREATE VIEW a4 as select .... from  a3(), .... ;
>
> In my opinion, this might leads to many problems such as
>
> 1.  A lot of garbage in the database including functions refers to non
> existing objects and views defined over these functions.
> 2.  This might also lead to some logical errors; especially, if you have a
> view defined over such functions and used in external applications.
> 3.  You will get also a broken dependency graph, in the above example it is
> obvious that a4 depends on a3 which depends on a2.

If that bothers you, organize views and functions into scripts so that
you can rebuild the entire suite at will.  In practice, I find the
problem of tables that functions depend on either A. disappearing or
B. structurally changing so that the fundamental behavior of the
function is broken to be a fairly rare problem.  It's much more common
to have to add fields, change types, etc.

merlin


pgsql-general by date:

Previous
From: salah jubeh
Date:
Subject: Re: function depend on view
Next
From: Andreas Kretschmer
Date:
Subject: Re: function depend on view