Search Postgresql Archives

Re: replacing expresion in plpgsql

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

 



On Mon, Dec 16, 2013 at 2:08 AM, John R Pierce <pierce@xxxxxxxxxxxx> wrote:
> On 12/15/2013 10:54 PM, Thomas Kellerer wrote:
>>
>> Both are valid. interval '2' day is the ANSI SQL format though.
>
>
> oh, really!   ah, I stand corrected, didn't realize the units were valid
> keywords like that.

Me neither.   Stuff like this is black magic implemented in the
parser...I always avoid it when I can.  I would have done it like
this:

newexpdate := CURRENT_TIMESTAMP +  (expdays || ' days')::interval;

merlin


-- 
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