Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 4BC7D64FCC3 for ; Sat, 22 Nov 2008 01:51:30 -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 07174-01 for ; Sat, 22 Nov 2008 01:51:27 -0400 (AST) X-Greylist: delayed 00:06:16.328534 by SQLgrey-1.7.6 Received: from smtp21.orange.fr (smtp21.orange.fr [80.12.242.46]) by mail.postgresql.org (Postfix) with ESMTP id 6777564FCC0 for ; Sat, 22 Nov 2008 01:51:27 -0400 (AST) Received: from smtp21.orange.fr (mwinf2113 [10.232.7.41]) by mwinf2105.orange.fr (SMTP Server) with ESMTP id 320441C01F11 for ; Sat, 22 Nov 2008 06:45:14 +0100 (CET) Received: from [192.168.66.1] (AMontpellier-158-1-45-171.w90-37.abo.wanadoo.fr [90.37.140.171]) by mwinf2113.orange.fr (SMTP Server) with ESMTP id 599B31C00086; Sat, 22 Nov 2008 06:45:08 +0100 (CET) X-ME-UUID: 20081122054508367.599B31C00086@mwinf2113.orange.fr Message-ID: <49279C63.8090909@laposte.net> Date: Sat, 22 Nov 2008 06:45:07 +0100 From: Francois Figarola User-Agent: Mozilla-Thunderbird 2.0.0.17 (X11/20081018) MIME-Version: 1.0 To: Zagato Cc: pgsql-admin@postgresql.org Subject: Re: Interval Format References: <98028b00811211739qb4a5e6bqf478bee397ea3596@mail.gmail.com> <98028b00811211740r44025235nf81578e1e9436f1d@mail.gmail.com> In-Reply-To: <98028b00811211740r44025235nf81578e1e9436f1d@mail.gmail.com> X-Enigmail-Version: 0.95.0 OpenPGP: id=39E5CD79 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200811/133 X-Sequence-Number: 30787 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello, Zagato a écrit : > 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=# 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çois Figarola. - -- - ---------------------------- L'éducation, c'est un peu comme une maladie sexuellement transmissible. Ca rend inapte à des tas de besognes, puis ça démange d'en faire profiter les autres. Terry Pratchett in "Le père 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 =3Ww3 -----END PGP SIGNATURE-----