Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id DC3F89FB8E1; Thu, 14 Jun 2007 08:14:25 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 73667-03; Thu, 14 Jun 2007 08:14:16 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from svana.org (svana.org [203.190.233.187]) by postgresql.org (Postfix) with ESMTP id 9AB809FB7CC; Thu, 14 Jun 2007 08:14:16 -0300 (ADT) Received: from kleptog by svana.org with local (Exim 4.50) id 1HynH9-00032a-Ss; Thu, 14 Jun 2007 21:14:03 +1000 Date: Thu, 14 Jun 2007 13:14:03 +0200 From: Martijn van Oosterhout To: Pavel Stehule Cc: Ashish Karalkar , pgsql-general@postgresql.org, pgsql-sql@postgresql.org Subject: Re: [SQL] function to find difference between in days between two dates Message-ID: <20070614111403.GA11436@svana.org> Reply-To: Martijn van Oosterhout Mail-Followup-To: Pavel Stehule , Ashish Karalkar , pgsql-general@postgresql.org, pgsql-sql@postgresql.org References: <006101c7ae4c$ed7edbd0$170211ac@LIONKING.COM> <162867790706140000w478d4bds4a0a2f42a8666a26@mail.gmail.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Kj7319i9nmIyA2yE" Content-Disposition: inline In-Reply-To: <162867790706140000w478d4bds4a0a2f42a8666a26@mail.gmail.com> X-PGP-Key-ID: Length=1024; ID=0x0DC67BE6 X-PGP-Key-Fingerprint: 295F A899 A81A 156D B522 48A7 6394 F08A 0DC6 7BE6 X-PGP-Key-URL: User-Agent: Mutt/1.5.9i X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: kleptog@svana.org X-SA-Exim-Scanned: No (on svana.org); SAEximRunCond expanded to false X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200706/837 X-Sequence-Number: 115660 --Kj7319i9nmIyA2yE Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jun 14, 2007 at 09:00:12AM +0200, Pavel Stehule wrote: > Hello >=20 > PostgreSQL hasn't any official function for it. If you need it, you > can write own function Not true. Anything that is done by an operator as actually done by a function. So the function exists: # \df date_mi List of functions Schema | Name | Result data type | Argument data types ------------+---------+------------------+--------------------- pg_catalog | date_mi | integer | date, date (1 row) You may have to dig through the pg_operator table to find it though. Have a nice day, --=20 Martijn van Oosterhout http://svana.org/kleptog/ > From each according to his ability. To each according to his ability to l= itigate. --Kj7319i9nmIyA2yE Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) iD8DBQFGcSL7IB7bNG8LQkwRAi7iAJ9YhglbSQE0ycZRdWN9MsF7WBM3rACeMKgD jOL6f8MuPPT/DghYEy3IXxg= =T1yI -----END PGP SIGNATURE----- --Kj7319i9nmIyA2yE--