Search Postgresql Archives

Re: Let-bindings in SQL statements

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2012-01-26, David Johnston <polobo@xxxxxxxxx> wrote:

> Is it possible to do the equivalent of let-bindings in a pure SQL function?
> I have a SELECT that invokes "now" multiple times.  It would be nicer to do
> it only once and reuse the value.  Something like this:

There is no need. now() is tagged as stable. it will only be executed once.

the planner will figure this out for you.

-- 
⚂⚃ 100% natural


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


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux