Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id B638864FE81 for ; Sat, 22 Nov 2008 02:08:22 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 12305-02 for ; Sat, 22 Nov 2008 02:08:17 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.191]) by mail.postgresql.org (Postfix) with ESMTP id 4EE4D64FCF5 for ; Sat, 22 Nov 2008 02:08:17 -0400 (AST) Received: by nf-out-0910.google.com with SMTP id c7so736996nfi.23 for ; Fri, 21 Nov 2008 22:08:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type:references; bh=KnJMZ5PcIsaXg3B25otfcQ0/MiSE+/xDhCEVE/G5OZg=; b=tGSHR6027//mY46BPFPb8v5m5NWona6SDpVed9lLGXuhkQc98JbQ67HM8iXLFiXX9R +0B74xkjt4qZg+Nh3DylOThixA78YOpgKrkQwh0nlpX4bn/8wsoBuFq5D7FjUf1uaUkF smAjjn6/BePzhPLAUrJIz6ZM37qiZfkYbG9QY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:references; b=dSRmf36w+GZxUF09f4aOCMs5XBOX6Rf4a27PKZwHW+Rje48V1SGmP9xAPdBhPjWSgH j95YLUt3TsYxASKrKCt51zukXCs1mpZhZ40o0ykkgd6bKswlQjJEzx02kfuhhHAA3V21 UyM8sxfSiOww0hWeQExXoc91h/IeIe6R0HzFo= Received: by 10.210.51.10 with SMTP id y10mr1386997eby.87.1227334095689; Fri, 21 Nov 2008 22:08:15 -0800 (PST) Received: by 10.210.111.17 with HTTP; Fri, 21 Nov 2008 22:08:15 -0800 (PST) Message-ID: <98028b00811212208p5cc28e78ucf688640c3ec6f84@mail.gmail.com> Date: Sat, 22 Nov 2008 01:08:15 -0500 From: Zagato To: "Francois Figarola" Subject: Re: Interval Format Cc: pgsql-admin@postgresql.org In-Reply-To: <49279C63.8090909@laposte.net> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_144980_1405123.1227334095671" References: <98028b00811211739qb4a5e6bqf478bee397ea3596@mail.gmail.com> <98028b00811211740r44025235nf81578e1e9436f1d@mail.gmail.com> <49279C63.8090909@laposte.net> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.001 tagged_above=0 required=5 tests=HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 200811/134 X-Sequence-Number: 30788 ------=_Part_144980_1405123.1227334095671 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Douh..... !!! Jejej... well i think that if not possible to use a some kind of default_justify_inteval, then i will try to update my SQLs... Thanks :D Alan Jairo Acosta On Sat, Nov 22, 2008 at 12:45 AM, Francois Figarola < francois.figarola@laposte.net> wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hello, > > Zagato a =E9crit : > > Hi everyone... im looking for some help with the interval format > > between two diferents versions of postgres.... > > I have instaled in my old server postgres 8.0.3 and in my new one > > postgres 8.3.5. .. > > Everything in both looks works nice but i notice a little difference > > that is taking my crazy.. > > I have som SQL that in 8.0.3 do: > > # SELECT '32 hours'::INTERVAL; > > interval > > ----------------- > > @ 1 day 8 hours > > (1 row) > > > > And in 8.3.5 do: > > seg_veh2=3D# SELECT '@ 32 hours'::INTERVAL; > > interval > > ------------ > > @ 32 hours > > (1 row) > If you really want your interval in normalized form (like days , hours > parts...) > with versions from 8.1 and newers, you must use the justify_* function : > > |SELECT justify_hours('@ 32 hours'::INTERVAL); > > will give you : > > justify_hours > - ---------------- > 1 day 08:00:00 > > and > > SELECT justify_days('45 days @ 32 hours'::INTERVAL); > > give > > justify_days > - ------------------------ > 1 mon 15 days 32:00:00 > > or global function > > ||SELECT justify_interval('45 days @ 32 hours'::INTERVAL); > > will give > > justify_interval > - ------------------------ > 1 mon 16 days 08:00:00 > > | > > > > 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: > > ERROR: unrecognized configuration parameter "intervalstyle" > > looking throw the forums i get that this new param its just for > > postgres 8.4... > > So.. how can i recover my "days" part... > > > > Any help it appreciate... thanks :D > Hope it can helps ! > > > > Alan Jairo Acosta > > > Regards, Fran=E7ois Figarola. > > - -- > - ---------------------------- > > L'=E9ducation, c'est un peu comme une maladie sexuellement transmissible. > Ca rend inapte =E0 des tas de besognes, puis =E7a d=E9mange d'en faire > profiter les autres. > Terry Pratchett in "Le p=E8re Porcher" (coll. Les Annales du Disque-Monde= ). > > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.9 (GNU/Linux) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iEYEARECAAYFAkknnGMACgkQXRu8MjnlzXks1wCaA+RIqhPk5BuGJeJ/jTn24Sg1 > OPcAn39TO8vBYRuWcBuyysPl6+L0cD4L > =3D3Ww3 > -----END PGP SIGNATURE----- > > ------=_Part_144980_1405123.1227334095671 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Douh..... !!! Jejej... well i think that if not possible to use a some kind= of default_justify_inteval, then i will try to update my SQLs...

T= hanks :D

Alan Jairo Acosta

On Sat,= Nov 22, 2008 at 12:45 AM, Francois Figarola <francois.figarola@laposte.net= > wrote:
-----BEGIN PGP SI= GNED MESSAGE-----
Hash: SHA1

Hello,

Zagato a =E9crit :
> Hi everyone... im looking for some help with the= interval format
> between two diferents versions of postgres....
> I have instaled in my old server postgres 8.0.3 and in my new one
> postgres 8.3.5. = <http://8.3.5./>..
> Everything in both looks works nice but i notice= a little difference
> that is taking my crazy..
> I have som SQL that in 8.0.3 do:
> # SELECT '32 hours'::INTERVAL;
>     interval
> -----------------
>  @ 1 day 8 hours
> (1 row)
>
> And in 8.3.5 do:
> seg_veh2=3D# SELECT '@ 32 hours'::INTERVAL;
>   interval
> ------------
>  @ 32 hours
> (1 row)
If you really want your interval in normalized form (like days , hour= s
parts...)
with versions from 8.1 and newers, you must use the justify_* function :
|SELECT justify_hours('@ 32 hours'::INTERVAL);

will give you :

 justify_hours
- ----------------
 1 day 08:00:00

and

SELECT justify_days('45 days @ 32 hours'::INTERVAL);

give

     justify_days
- ------------------------
 1 mon 15 days 32:00:00

or global function

||SELECT justify_interval('45 days @ 32 hours'::INTERVAL);

will give

   justify_interval
- ------------------------
 1 mon 16 days 08:00:00

|
>
> 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:
> ERROR:  unrecognized configuration parameter "intervalstyle&= quot;
> looking throw the forums i get that this new param its just for
> postgres 8.4...
> So.. how can i recover my "days" part...
>
> Any help it appreciate... thanks :D
Hope it can helps !
>
> Alan Jairo Acosta
>
Regards, Fran=E7ois Figarola.

- --
- ----------------------------

L'=E9ducation, c'est un peu comme une maladie sexuellement transmis= sible.
Ca rend inapte =E0 des tas de besognes, puis =E7a d=E9mange d'en faire<= br> profiter les autres.
Terry Pratchett in "Le p=E8re Porcher" (coll. Les Annales du Disq= ue-Monde).

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkknnGMACgkQXRu8MjnlzXks1wCaA+RIqhPk5BuGJeJ/jTn24Sg1
OPcAn39TO8vBYRuWcBuyysPl6+L0cD4L
=3D3Ww3
-----END PGP SIGNATURE-----




------=_Part_144980_1405123.1227334095671--