Re: Question about PARTIAL DATE type/s - Mailing list pgsql-general

From r d
Subject Re: Question about PARTIAL DATE type/s
Date
Msg-id CALtFtE+3+469HtdJcWQTGiXcNzONG+B91ne4wXy0Wsg71JKcTQ@mail.gmail.com
Whole thread Raw
In response to Re: Question about PARTIAL DATE type/s  (Daniele Varrazzo <daniele.varrazzo@gmail.com>)
List pgsql-general
I suspected that this would be the answer.

Thank you lots for your kind help, Daniele & Tom 

On 7 October 2012 16:46, Daniele Varrazzo <daniele.varrazzo@gmail.com> wrote:
On Sun, Oct 7, 2012 at 3:03 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Daniele Varrazzo <daniele.varrazzo@gmail.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

Attachment

pgsql-general by date:

Previous
From: Vincent Veyron
Date:
Subject: Re: [PL/PGSQL] column name substitution in PG8.4
Next
From: Scott Marlowe
Date:
Subject: Re: [Mac OS X Mountain Lion] FATAL: could not create shared memory segment: Cannot allocate memory