Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql Sql > Re: using calcu...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 9 of 9 Topic 3533 of 3799
Post > Topic >>

Re: using calculated column in where-clause

by tgl@[EMAIL PROTECTED] (Tom Lane) Jun 19, 2008 at 02:38 PM

"Fernando Hevia" <fhevia@[EMAIL PROTECTED]
> writes:
> -- In this case function test is called only once:
> pg=# select res[0] as sum, res[1] as prod, res[2] as dif from
> pg-# (select (test(1, 2))::integer[] as res) t ;

That's an implementation artifact, not a guaranteed behavior;
if you change the example a bit you'll find multiple calls
happening.

(In recent releases you'd actually have a better chance of
not having multiple calls if you'd declared it volatile
instead of immutable.)

			regards, tom lane

-- 
Sent via pgsql-sql mailing list (pgsql-sql@[EMAIL PROTECTED]
)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
 




 9 Posts in Topic:
using calculated column in where-clause
pittipatti@[EMAIL PROTECT  2008-06-17 22:46:08 
Re: using calculated column in where-clause
akretschmer@[EMAIL PROTEC  2008-06-17 23:10:41 
Re: using calculated column in where-clause
pittipatti@[EMAIL PROTECT  2008-06-18 07:31:32 
Re: using calculated column in where-clause
scott.marlowe@[EMAIL PROT  2008-06-17 15:15:13 
Re: using calculated column in where-clause
fhevia@[EMAIL PROTECTED]   2008-06-18 16:35:48 
Re: using calculated column in where-clause
scott.marlowe@[EMAIL PROT  2008-06-18 14:47:08 
Re: using calculated column in where-clause
fhevia@[EMAIL PROTECTED]   2008-06-19 15:23:48 
Re: using calculated column in where-clause
fhevia@[EMAIL PROTECTED]   2008-06-19 15:32:53 
Re: using calculated column in where-clause
tgl@[EMAIL PROTECTED] (T  2008-06-19 14:38:24 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Tue Dec 2 21:33:44 CST 2008.