Re: Fwd: Re: Dynamic update of a date field

From: Jasen Betts <jasen(at)xnet(dot)co(dot)nz>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Fwd: Re: Dynamic update of a date field
Date: 2012-02-19 07:37:40
Message-ID: jhq8s4$17h$2@reversiblemaps.ath.cx
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 2012-02-16, David Salisbury <salisbury(at)globe(dot)gov> wrote:
>
>
> On 2/16/12 7:27 AM, Andreas Kretschmer wrote:
>> Musial, Jan (GIUB)<jan(dot)musial(at)giub(dot)unibe(dot)ch> wrote:
>>> smallint,month smallint,day smallint,time_stamp date); I would like to
>>
>> That's silly, use one (and only one) field, timestamp (or timestamptz)
>> Don't use never ever multiple columns for the same information!
>
> Would it not be advantageous to replicate information in the above
> form if you wanted to, say, get all records in the month of May, and
> therefore create an index on the month field? I would think that
> would be more efficient than creating a functional index on a timestamp.
> And if you're not too picky, that would give an index that couldn't
> be done on a timestamptz field, as that's mutable.

using "at timezone ...." can convert timestamptz to timestamp.
which can then be fragmented immutably for indexing using extract
or to_char.

--
⚂⚃ 100% natural

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jasen Betts 2012-02-19 07:51:13 Re: Fwd: Re: Dynamic update of a date field
Previous Message Jasen Betts 2012-02-19 07:31:13 Re: Easy form of "insert if it isn't already there"?