Re: Views- Advantages and Disadvantages

From: PFC <lists(at)peufeu(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Leif B(dot) Kristensen" <leif(at)solumslekt(dot)org>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Views- Advantages and Disadvantages
Date: 2007-05-11 05:43:17
Message-ID: op.tr5d6fgncigqcu@apollo13
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, 11 May 2007 04:24:55 +0200, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> "Leif B. Kristensen" <leif(at)solumslekt(dot)org> writes:
>> Would it be reasonable to suggest that later versions of PostgreSQL
>> could examine if a function changes data, and quietly marks a function
>> as 'stable' if it doesn't?
>
> My instinctive CS-major reply to that is "only if you've found a
> solution to the halting problem". However, it's possible that we could
> detect this case for a useful subset of real-world functions ... not
> sure offhand what could be covered.
>
> regards, tom lane

Why not simply have PG issue a warning if the user doesn't specify one of
("stable", "immutable", etc) on function creation ?
like :

WARNING: Function marked as Volatile by default
INFO: if the function does not modify the database, you might want to mark
it STABLE or IMMUTABLE to improve performance

In response to

Browse pgsql-general by date

  From Date Subject
Next Message anhtin 2007-05-11 06:53:33 Re: backup and restore
Previous Message Ron Johnson 2007-05-11 04:08:10 Re: Views- Advantages and Disadvantages