Search Postgresql Archives

Re: Passing varchar parameter to INTERVAL

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

 



Hello Rob,

On Wed, Sep 7, 2016 at 3:24 PM, rob stone <floriparob@xxxxxxxxx> wrote:

I think the interval values need to be quoted.
In any event I always use the P or T syntax. 'P1D' means add one day,

unfortunately, I can not call INTERVAL 'in_until', that wouldn't work.

Also 'P1D' vs. '1 day' seems to be just a matter of taste.

Finally, to provide more context to my question -

I would prefer to call my custom function as

    select words_ban_user(1, '1 day', 'attacking other users');

and not as

    select words_ban_user(1, CURRENT_TIMESTAMP + '1 day', 'attacking other users');

because additionally to the temporary ban I would like to prolong VIP-periods for paying users (to avoid discussions) - and that would be more difficult in the latter case (would require more date acrobatics)...

Regards
Alex


[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