Re: Division by zero - Mailing list pgsql-general

From Tom Lane
Subject Re: Division by zero
Date
Msg-id 12861.1244123297@sss.pgh.pa.us
Whole thread Raw
In response to Re: Division by zero  (Sam Mason <sam@samason.me.uk>)
Responses Re: Division by zero
List pgsql-general
Sam Mason <sam@samason.me.uk> writes:
> If it's an SQL function and marked as IMMUTABLE it should (I believe
> anyway) get inlined somewhere along the line and take no more overhead
> than writing it out in full.

Actually, if you're intending that a SQL function be inline-able then
it's best *not* to mark it as IMMUTABLE (nor STRICT either).  If the
marking matches the behavior of the contained expression then it
doesn't matter, but if the marking is stricter than the expression
it will prevent inlining.  Rather than think hard, I usually just don't
annotate the SQL function at all.

            regards, tom lane

pgsql-general by date:

Previous
From: "Carlos Oliva"
Date:
Subject: Re: Upgrading Database: need to dump and restore?
Next
From: Greg Smith
Date:
Subject: Re: warm standby with WAL shipping