Re: adding years to a date field
От
John R Pierce
Тема
Re: adding years to a date field
Дата
Msg-id
4D9CE87F.6050002@hogranch.com
Ответ на
Re: adding years to a date field (Steve Crawford)
Список
Дерево обсуждения
adding years to a date field Christine Penner <chris@fp2.ca>
Re: adding years to a date field Adrian Klaver <adrian.klaver@gmail.com>
Re: adding years to a date field Christine Penner <chris@fp2.ca>
Re: adding years to a date field Karsten Hilbert <Karsten.Hilbert@gmx.net>
Re: adding years to a date field Michael Glaesemann <grzm@seespotcode.net>
Re: adding years to a date field Steve Crawford <scrawford@pinpointresearch.com>
Re: adding years to a date field John R Pierce <pierce@hogranch.com>
Re: adding years to a date field Steve Crawford <scrawford@pinpointresearch.com>
Re: adding years to a date field John R Pierce <pierce@hogranch.com>
On 04/06/11 1:18 PM, Steve Crawford wrote:
>> select ii_purchased + your_interval_field * interval '1 year' as date
>> from inventory_item;
>>
>>
>>
> Correct. I meant ...::interval...
FWIW, '1 year'::interval implies a cast, that is a postgresql-specific
notation for cast('1 year' as interval), while interval '1 year' is the
SQL standard notation for an interval constant. yes, the end results
are the same, the parser/optimizer will look at that cast and do it in
advance rather than at execution time since the input is invariant.
В списке pgsql-general по дате отправления