On 2014-09-01 12:49:22 +0200, Marko Tiikkaja wrote:
> On 9/1/14 12:12 PM, Andres Freund wrote:
> >On 2014-09-01 12:00:48 +0200, Marko Tiikkaja wrote:
> >>On 9/1/14 11:53 AM, Hannu Krosing wrote:
> >>>>You're going to have to find a more gradual way of doing this.
> >>>Probably a better way (and there has been some talk of it) is
> >>>having some kind of PRAGMA functionality, or pl/pgsql specific
> >>>LOCAL SET to affect "just this function" and not spill to nested
> >>>functions as is the case for SETs now.
> >>
> >>I can't imagine how that would work for anyone who has thousands of
> >>functions.
> >
> >How's that fundamentally different from changing languages? If we had a
> >way to *add* such attributes to *existing* functions I don't see the
> >fundamental problem?
> 
> Adding 5-10 of these for every function you create seems significantly more
> painful than saying "this function uses plpgsql2".  Though perhaps what's
> being suggested is a *single* option which changes everything at once?  Then
> there wouldn't be a huge difference.

The likelihood of us now knowing all the things that we want to break
rigth now seems about zero. There *will* be further ones. If we go with
the approach of creating new language versions for all of them we'll end
up with a completely unmaintainable mess. For PG devs, application dev
and DBAs.

Since what you seemingly want - sensibly so imo - is to set the default
errors for *new* functions, but leave the old set of errors for
preexisting ones, I suggest adding a GUC that defines the set of
warnings/errors *new* functions get. There'd need to be some syntax to
opt out for pg_dump and similar, but that sounds unproblematic.

One question here imo is whether we design something for plpgsql or more
generic...

Greetings,

Andres Freund

-- 
 Andres Freund                     http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to