Re: Question about PARTIAL DATE type/s

From: Daniele Varrazzo <daniele(dot)varrazzo(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: r d <rd0002(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Question about PARTIAL DATE type/s
Date: 2012-10-07 14:46:14
Message-ID: CA+mi_8bQnReqWBacU-xA3SEgwHWy=P60nvjKnYFXjH+XerMmnA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sun, Oct 7, 2012 at 3:03 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Daniele Varrazzo <daniele(dot)varrazzo(at)gmail(dot)com> writes:
>> Note: it exploits to_date() parsing '200013' as '2001-01', which is
>> reasonable but haven't found documented and don't know how much
>> reliable. Writing a safer "one month later" function is left as
>> exercise.
>
> Consider adding '1 month'::interval to the month start date.
>
> (This function relies on text-munging way too much for my taste.
> There's almost always a better way to do it than that.)

Didn't realize intervals store months/days info separately: I thought
an interval was just a vector in the timestamp space. Nice surprise.

-- Daniele

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message shehab adean sherif 2012-10-07 15:07:02 postgres 9.1 pgsql_tmp directory location of specific database?
Previous Message Edson Richter 2012-10-07 14:05:09 Re: Help with query timeout