Re: plpgsql_check_function - rebase for 9.3

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, Steve Singer <steve(at)ssinger(dot)info>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Josh Berkus <josh(at)agliodbs(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: plpgsql_check_function - rebase for 9.3
Date: 2013-12-10 06:45:52
Message-ID: CAFj8pRBmeX3PKiEYH6+Xuzawpzem-TU-fPJPxv8+Tgwdd6fFnA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2013/12/10 Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>

> On Mon, Dec 9, 2013 at 10:54 AM, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
> wrote:
> > 2013/12/9 Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
> >>
> >> >
> >> > There are two points, that should be solved
> >> >
> >> > a) introduction a dependency to other object in schema - now CREATE
> >> > FUNCTION
> >> > is fully independent on others
> >> >
> >> > b) slow start - if we check all paths on start, then start can be
> slower
> >> > -
> >> > and some functions should not work due dependency on temporary tables.
> >> >
> >> > I am thinking about possible marking a function by #option (we have
> same
> >> > idea)
> >> >
> >> > some like
> >> >
> >> > #option check_on_first_start
> >> > #option check_on_create
> >> > #option check_newer
> >>
> >> what exactly check_newer means, does it mean whenever a function is
> >> replaced (changed)?
> >>
> >
> > no, it means, so request for check will be ignored ever - some functions
> > cannot be deeply checked due using dynamic SQL or dynamic created data
> types
> > - temporary tables created in functions.
>
> Thanks for clarification, the part of name 'newer' has created
> confusion. I understand
> that creating/identifying dependency in some of the cases will be
> quite tricky, does other
> similar languages for other databases does that for all cases (objects
> in dynamic statements).
>

I am sorry

PL/pgSQL is really specific due invisible SQL base and mixing two
environments and languages in user visible area.

>
> Is the main reason for identifying/creating dependency is to mark
> function as invalid when
> any dependent object is Dropped/Altered?
>

Now, PG has no any tool for checking dependency between functions and other
objects. What has positive effects - we have very simply deploying, that
works in almost use cases very well - and works with our temporary tables
implementation. There is simple rule - depended object must living before
they are >>used in runtime<<. But checking should not be runtime event and
we would to decrease a false alarms. So we have to expect so almost all
necessary object are created - it is reason, why we decided don't do check
in create function statement time. We don't would to introduce new
dependency if it will be possible.

Regards

Pavel

> This thread is from quite some time, so please excuse me if I had
> asked anything which has
> been discussed previously.
>

> With Regards,
> Amit Kapila.
> EnterpriseDB: http://www.enterprisedb.com
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Etsuro Fujita 2013-12-10 07:05:56 Re: Get more from indices.
Previous Message Kyotaro HORIGUCHI 2013-12-10 06:43:18 Re: logical changeset generation v6.7