pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Zagato <zagato.gekko@gmail.com>
To: Ron Mayer <rm_pg@cheapcomplexdevices.com>
Cc: pgsql-general@postgresql.org
Subject: Re: Interval Format
Date: Fri, 21 Nov 2008 21:28:49 -0500
Message-ID: <98028b00811211828m2fdac1aq5be928ec819180f@mail.gmail.com> (raw)
In-Reply-To: <492766DF.2050902@cheapcomplexdevices.com>
References: <98028b00811211739qb4a5e6bqf478bee397ea3596@mail.gmail.com>
	<492766DF.2050902@cheapcomplexdevices.com>

Hi.. thanks for the answer.... well this work in the test sql, but this
needs to rewrite all the SQL in my PHP application :-p Jejej... can i set a
deatul time year in postgres.conf or with a single SET ... ?

Thanks..

Alan Acosta

On Fri, Nov 21, 2008 at 8:56 PM, Ron Mayer <rm_pg@cheapcomplexdevices.com>wrote:

> Zagato wrote:
>
>> I have som SQL that in 8.0.3 do:
>> # SELECT '32 hours'::INTERVAL;
>>    interval
>> -----------------
>>  @ 1 day 8 hours
>>
>> And in 8.3.5 do:
>> seg_veh2=# SELECT '@ 32 hours'::INTERVAL;
>>  interval
>> ------------
>>  @ 32 hours
>>
>> Why i unable to get my old style of interval, i really need to see the day
>> part.... im using datestyle german in both.... im try with "SET
>> IntervalStyle TO..." but i get this error:
>>
>
> Even IntervalStyle won't help you here; since recent releases consider
> the values "1 day 8 hours" as distinct from "32 hours" (because
> they are at certain times of the year in some timezones
> where days are 25 hours, etc).
>
>  So.. how can i recover my "days" part...
>>
>
> If you tell it what time of year you are thinking of this trick can work:
>
> dish=# set datestyle to german;
> SET
> dish=# select  '2001-01-01'::timestamp + (interval '32 hours') -
> '2001-01-01'::timestamp;
>    ?column?
> -----------------
>  @ 1 day 8 hours
> (1 row)
>
>
>
>> Any help it appreciate... thanks :D
>>
>
>

view thread (6+ messages)  latest in thread

Message-ID: <98028b00811211828m2fdac1aq5be928ec819180f@mail.gmail.com>
Permalink:  ../98028b00811211828m2fdac1aq5be928ec819180f@mail.gmail.com/
Also on:    postgresql.org/message-id/98028b00811211828m2fdac1aq5be928ec819180f@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: zagato.gekko@gmail.com, rm_pg@cheapcomplexdevices.com, pgsql-general@postgresql.org
  Subject: Re: Interval Format
  In-Reply-To: <98028b00811211828m2fdac1aq5be928ec819180f@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox