Re: 2 questions about volatile attribute of pg_proc.

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Isaac Morland <isaac(dot)morland(at)gmail(dot)com>, Andy Fan <zhihui(dot)fan1213(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: 2 questions about volatile attribute of pg_proc.
Date: 2021-04-18 16:27:01
Message-ID: CAKFQuwYHZDhoiTdx8X-wOVWzYcs9r6m7xD63dJww-U+OOjxrUQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, Apr 18, 2021 at 9:08 AM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> Isaac Morland <isaac(dot)morland(at)gmail(dot)com> writes:
> > On Sun, 18 Apr 2021 at 11:36, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> >> Are you familiar with the halting problem? I don't see any meaningful
> >> difference here.
>
> > I think what is being suggested is akin to type checking, not solving the
> > halting problem.
>
> Yeah, on further thought we'd be satisfied with a conservative
> approximation, so that removes the theoretical-impossibility objection.
> Still, there are a lot of remaining problems, as you note.
>
>
Yeah, the type checking approach seems blocked by the "black box" nature of
functions. A possibly more promising approach is for the top-level call to
declare its expectations (which are set by the user) and during execution
if that expectation is violated directly, or is reported as violated deeper
in the call stack, the execution of the function fails with some kind of
invalid state error. However, as with other suggestions of this nature,
the fundamental blocker here is that to be particularly useful this kind of
validation needs to happen by default (as opposed to opt-in) which risks
breaking existing code. And so I foresee this request falling into the
same category as those others - an interesting idea that could probably be
made to work but by itself isn't worthwhile enough to go and introduce a
fundamental change to the amount of "parental oversight" PostgreSQL tries
to provide.

David J.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Yulin PEI 2021-04-18 16:31:07 回复: Core dump happens when execute sql CREATE VIEW v1(c1) AS (SELECT ('4' COLLATE "C")::INT FROM generate_series(1, 10));
Previous Message Tom Lane 2021-04-18 16:08:14 Re: 2 questions about volatile attribute of pg_proc.