From ashish.karalkar@info-spectrum.com Thu Jun 14 06:31:02 2007 Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id A26FC9FBCF1; Thu, 14 Jun 2007 03:31:02 -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 81169-04; Thu, 14 Jun 2007 03:30:57 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from pro33.abac.com (pro33.abac.com [66.226.64.34]) by postgresql.org (Postfix) with ESMTP id 298D69FBD32; Thu, 14 Jun 2007 03:30:57 -0300 (ADT) Received: from ashishk (ppp92-7.vsnl.eth.net [61.17.93.7] (may be forged)) (authenticated bits=0) by pro33.abac.com (8.13.8/8.13.8) with ESMTP id l5E6Uli7012105 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO); Wed, 13 Jun 2007 23:30:52 -0700 (PDT) (envelope-from ashish.karalkar@info-spectrum.com) Message-ID: <006101c7ae4c$ed7edbd0$170211ac@LIONKING.COM> From: "Ashish Karalkar" To: , Subject: function to find difference between in days between two dates Date: Thu, 14 Jun 2007 11:56:15 +0530 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_005E_01C7AE7B.031BC330" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200706/829 X-Sequence-Number: 115652 This is a multi-part message in MIME format. ------=_NextPart_000_005E_01C7AE7B.031BC330 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hello all, Is there any function to find differences in days between two dates? I am using=20 select abs(current_date - '2007-06-15') =20 to get the desired result. but I think there must be a function and I am missing it, if so, can anybody please point me to that. Thanks in advance With regards Ashish Karalkar ------=_NextPart_000_005E_01C7AE7B.031BC330 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hello all,
 
Is there any function to find  = differences in=20 days between two dates?
 
 
I am using
 
select abs(current_date -=20 '2007-06-15')
 
to get the desired result.
but I think there must be a function = and I am=20 missing it,
if so, can anybody please point me to=20 that.
 
 
Thanks in advance
 
With regards
Ashish Karalkar
 
 
 
------=_NextPart_000_005E_01C7AE7B.031BC330-- From pavel.stehule@gmail.com Thu Jun 14 07:00:33 2007 Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 8D69D9FB3CB for ; Thu, 14 Jun 2007 04:00:33 -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 86693-10 for ; Thu, 14 Jun 2007 04:00:14 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 Received: from wr-out-0506.google.com (wr-out-0506.google.com [64.233.184.235]) by postgresql.org (Postfix) with ESMTP id 699379FB546 for ; Thu, 14 Jun 2007 04:00:14 -0300 (ADT) Received: by wr-out-0506.google.com with SMTP id 68so391444wri for ; Thu, 14 Jun 2007 00:00:13 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=s0vs9x8vRfpv3m7uLq6FhChIr+1jHozgKQOwJ2e0z6iXXqQ5btjki/1howOs13I0SvOGCdgz0cXRbfOhCYhV/aK5gV/1hfm8FWhEInoNk1FKqUvFC9wcYMgfNf57RvcPnCQtp7rlS3B5EeMdc7XwBpeDy0HAFNKGufQckOnI+Ng= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=W6o1OBVfNAqhQUv/d4oHfYayvhyR3kF2Hgo3H/XDH9ejK1iVAythr7V7edZaar83OTcxImX+lbChnUyQTXP8SghhYS5IyEe4SeL8KLmYPER1F+4J/N+mlzpB419/sjyDOTFqZ1zC5e8pfL4CVkvXZN3GokXdwoGkT+k52vw4BJ0= Received: by 10.143.160.1 with SMTP id m1mr78718wfo.1181804412822; Thu, 14 Jun 2007 00:00:12 -0700 (PDT) Received: by 10.142.80.10 with HTTP; Thu, 14 Jun 2007 00:00:12 -0700 (PDT) Message-ID: <162867790706140000w478d4bds4a0a2f42a8666a26@mail.gmail.com> Date: Thu, 14 Jun 2007 09:00:12 +0200 From: "Pavel Stehule" To: "Ashish Karalkar" Subject: Re: [SQL] function to find difference between in days between two dates Cc: pgsql-general@postgresql.org, pgsql-sql@postgresql.org In-Reply-To: <006101c7ae4c$ed7edbd0$170211ac@LIONKING.COM> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <006101c7ae4c$ed7edbd0$170211ac@LIONKING.COM> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200706/830 X-Sequence-Number: 115653 Hello PostgreSQL hasn't any official function for it. If you need it, you can write own function CREATE FUNCTION date_diff(date, date) returns integer as $$ select $1-$2; $$ language sql; Regards Pavel Stehule 2007/6/14, Ashish Karalkar : > > > Hello all, > > Is there any function to find differences in days between two dates? > > > I am using > > select abs(current_date - '2007-06-15') > > to get the desired result. > but I think there must be a function and I am missing it, > if so, can anybody please point me to that. > > > Thanks in advance > > With regards > Ashish Karalkar > > > From andreas.kretschmer@schollglas.com Thu Jun 14 07:02:57 2007 Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id DC6CB9FB546 for ; Thu, 14 Jun 2007 04:02:57 -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 92450-02 for ; Thu, 14 Jun 2007 04:02:48 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.186]) by postgresql.org (Postfix) with ESMTP id 7437A9FB3CB for ; Thu, 14 Jun 2007 04:02:48 -0300 (ADT) Received: from [194.25.154.138] (helo=webserv.wug.de) by mrelayeu.kundenserver.de (node=mrelayeu7) with ESMTP (Nemesis), id 0ML2xA-1HyjLz0Ukn-0000uu; Thu, 14 Jun 2007 09:02:47 +0200 Received: from kretschmer by webserv.wug.de with local (Exim 3.36 #1) id 1HyjLy-00052R-00 for pgsql-sql@postgresql.org; Thu, 14 Jun 2007 09:02:46 +0200 Date: Thu, 14 Jun 2007 09:02:46 +0200 From: "A. Kretschmer" To: pgsql-sql@postgresql.org Subject: Re: function to find difference between in days between two dates Message-ID: <20070614070246.GB16034@a-kretschmer.de> References: <006101c7ae4c$ed7edbd0$170211ac@LIONKING.COM> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <006101c7ae4c$ed7edbd0$170211ac@LIONKING.COM> X-OS: Debian/GNU Linux - weil ich es mir Wert bin! X-Message-Flag: "Windows" is not the answer. "Windows" is the question and the answer is "no"! User-Agent: Mutt/1.5.9i X-Provags-ID: V01U2FsdGVkX19/YVLw6yFAQnPXejuUkn60YI7vZlAxGqK6mjz dz7gfamopO1rVidw37AEDSzSuLzc1OURY8mUyqOfi75BubvYxI GEA+RGvkukAJji8z7wigk0y0qyi60TG X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200706/101 X-Sequence-Number: 28591 am Thu, dem 14.06.2007, um 11:56:15 +0530 mailte Ashish Karalkar folgendes: > Hello all, > > Is there any function to find differences in days between two dates? Yes, age(). Andreas -- Andreas Kretschmer Kontakt: Heynitz: 035242/47150, D1: 0160/7141639 (mehr: -> Header) GnuPG-ID: 0x3FFF606C, privat 0x7F4584DA http://wwwkeys.de.pgp.net From pavel.stehule@gmail.com Thu Jun 14 07:39:36 2007 Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id BD5199FB63D for ; Thu, 14 Jun 2007 04:39:36 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 66660-01 for ; Thu, 14 Jun 2007 04:39:24 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from wr-out-0506.google.com (wr-out-0506.google.com [64.233.184.234]) by postgresql.org (Postfix) with ESMTP id 51E7F9FB7E4 for ; Thu, 14 Jun 2007 04:39:33 -0300 (ADT) Received: by wr-out-0506.google.com with SMTP id 68so398073wri for ; Thu, 14 Jun 2007 00:39:32 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=G/zHEUX6j/GNs+ckeZOxEOoBAc3seZmhhs2G8yevhyQfIOoU5dPYWkGmhcMebfmNN9m5nfU1NkFDgjZ04QzkzLVtw6Cql8u1cTR14O/x2MgAW5EFO2e7iDbyC48NCsvNO2hqLisqmRBomp8gX1GR88H3dd5R+h3ljcMey+nVyXo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=dP7y+L4L4hKkaT8fNHor8fJpa1zCbLKK8J81mYIagUCtJ6HT5qY84X3PhGNkx0xycxjIsnYK+zl+DKhuIZRJYlI8+trxK4wnRCw7jvs6UZAvgiZJKXeMeiJtHct/u5omozOj+6xggkpCQaOxNuPcsGHE4nldAESE+elvJsWhYek= Received: by 10.142.255.14 with SMTP id c14mr77943wfi.1181806771822; Thu, 14 Jun 2007 00:39:31 -0700 (PDT) Received: by 10.142.80.10 with HTTP; Thu, 14 Jun 2007 00:39:31 -0700 (PDT) Message-ID: <162867790706140039j569676a3na70918a65e542f58@mail.gmail.com> Date: Thu, 14 Jun 2007 09:39:31 +0200 From: "Pavel Stehule" To: "A. Kretschmer" Subject: Re: function to find difference between in days between two dates Cc: pgsql-sql@postgresql.org In-Reply-To: <20070614070246.GB16034@a-kretschmer.de> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <006101c7ae4c$ed7edbd0$170211ac@LIONKING.COM> <20070614070246.GB16034@a-kretschmer.de> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200706/103 X-Sequence-Number: 28593 2007/6/14, A. Kretschmer : > am Thu, dem 14.06.2007, um 11:56:15 +0530 mailte Ashish Karalkar folgendes: > > Hello all, > > > > Is there any function to find differences in days between two dates? > > Yes, age(). > > there is difference date - date --> integer age(date::timestamp, date::timestamp) --> interval regards Pavel From kleptog@svana.org Thu Jun 14 11:14:25 2007 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-- From pavel.stehule@gmail.com Thu Jun 14 11:54:15 2007 Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 412259FBE14 for ; Thu, 14 Jun 2007 08:54:15 -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 84071-01 for ; Thu, 14 Jun 2007 08:54:11 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 Received: from nz-out-0506.google.com (nz-out-0506.google.com [64.233.162.235]) by postgresql.org (Postfix) with ESMTP id BA8199FB929 for ; Thu, 14 Jun 2007 08:54:11 -0300 (ADT) Received: by nz-out-0506.google.com with SMTP id m22so456934nzf for ; Thu, 14 Jun 2007 04:54:10 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=scoXkImKnGo1OefgWphiOGVQTn2WYKh6LD0eNGkYHv8ezNOBEVBxUZ3yKUvIU8IAVoUAdhNav2WuKgA6py56yJKee268gm/v9e4fb5vi4adGdmREZR8kMBvmtwlMtYd2Gv/X7Mb6YbHcez7YXJsp1kxwPPHXeUF+EhLa7POeuIg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=DYYBXSpx0+FpG6nun04hSHpvNnhxT54/+epbUucMVa++oUYZGOXwgR3Hem9CSKQh1/JQVRtsKogyKoqHe9DIat9EJYZUNULcHiT/gWAG0wBU07mtbVHJ4CYGBSD3k7yBwKtJxkITqOjM+oo75VjT/mlK5RiCP+dWckT5ZhDr59U= Received: by 10.143.163.21 with SMTP id q21mr90347wfo.1181822049838; Thu, 14 Jun 2007 04:54:09 -0700 (PDT) Received: by 10.142.80.10 with HTTP; Thu, 14 Jun 2007 04:54:09 -0700 (PDT) Message-ID: <162867790706140454q5e08cff6n22ed5d58748949ed@mail.gmail.com> Date: Thu, 14 Jun 2007 13:54:09 +0200 From: "Pavel Stehule" To: "Martijn van Oosterhout" , "Pavel Stehule" , "Ashish Karalkar" , pgsql-general@postgresql.org, pgsql-sql@postgresql.org Subject: Re: [SQL] function to find difference between in days between two dates In-Reply-To: <20070614111403.GA11436@svana.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <006101c7ae4c$ed7edbd0$170211ac@LIONKING.COM> <162867790706140000w478d4bds4a0a2f42a8666a26@mail.gmail.com> <20070614111403.GA11436@svana.org> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200706/840 X-Sequence-Number: 115663 2007/6/14, Martijn van Oosterhout : > On Thu, Jun 14, 2007 at 09:00:12AM +0200, Pavel Stehule wrote: > > Hello > > > > 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 I know about it, but it's undocumented Pavel From kleptog@svana.org Thu Jun 14 12:30:23 2007 Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id CFE599FBE09; Thu, 14 Jun 2007 09:30:23 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 18088-01; Thu, 14 Jun 2007 09:30:05 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) by postgresql.org (Postfix) with ESMTP id 3E0889FBD93; Thu, 14 Jun 2007 09:30:16 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.3 X-Greylist: domain auto-whitelisted by SQLgrey-1.7.3 Received: from svana.org (svana.org [203.190.233.187]) by svr4.postgresql.org (Postfix) with ESMTP id EC8C85AF02C; Thu, 14 Jun 2007 12:30:14 +0000 (GMT) Received: from kleptog by svana.org with local (Exim 4.50) id 1HyoPE-0003aF-LY; Thu, 14 Jun 2007 22:26:28 +1000 Date: Thu, 14 Jun 2007 14:26:28 +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: <20070614122628.GB11436@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> <20070614111403.GA11436@svana.org> <162867790706140454q5e08cff6n22ed5d58748949ed@mail.gmail.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ADZbWkCsHQ7r3kzd" Content-Disposition: inline In-Reply-To: <162867790706140454q5e08cff6n22ed5d58748949ed@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/843 X-Sequence-Number: 115666 --ADZbWkCsHQ7r3kzd Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jun 14, 2007 at 01:54:09PM +0200, Pavel Stehule wrote: > ># \df date_mi >=20 > I know about it, but it's undocumented Hrm, yet Bruce mentions it in one of his documents. http://momjian.us/main/writings/pgsql/data_processing.pdf It may be undocumented, but it get a lot of hits on google :) 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. --ADZbWkCsHQ7r3kzd 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) iD8DBQFGcTP0IB7bNG8LQkwRAmH0AKCJiESKv6wy07NA3eBxr3X0iBdkIACeK9Ti cNyGb+yOI6b3jS6zDzXaO/I= =Kkn0 -----END PGP SIGNATURE----- --ADZbWkCsHQ7r3kzd-- From pavel.stehule@gmail.com Thu Jun 14 12:47:15 2007 Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id CDB199FB715 for ; Thu, 14 Jun 2007 09:47:15 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 19963-03 for ; Thu, 14 Jun 2007 09:47:11 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from wr-out-0506.google.com (wr-out-0506.google.com [64.233.184.225]) by postgresql.org (Postfix) with ESMTP id E758F9FB7BC for ; Thu, 14 Jun 2007 09:47:11 -0300 (ADT) Received: by wr-out-0506.google.com with SMTP id 68so459521wri for ; Thu, 14 Jun 2007 05:47:10 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=TJr86kuowXJkiAmUdzetb2m3Zj8KhpOB0KAdQWkRCtJ13p8OCSVZW5UpQpauzo+dXwNPvgVvEdzGSo9E4ijEdehLDl8eKHIKpi57BSPvURqHCCew8JYjNU+7l5PFhJNEHlFamnMOrEtlVhGP5KdcwXhjBG4s+Btio0+CxupRi0M= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=G8ft4i/z3qw7OJegz6Eh5TW314gHUyUJii8JhIwTnYluBglg1TdwR3TPTT6hYLYV3LpnIqY5pFtVdKloMMg6dl4oSYxMocrCrCKBYxDB1DeM3kiHwE3Ak9E7LeeCESZ9rpriy+swJT4xP/qBvH3mJtYowiYCKpxZlZ5unTa8Me8= Received: by 10.142.98.18 with SMTP id v18mr91415wfb.1181825229453; Thu, 14 Jun 2007 05:47:09 -0700 (PDT) Received: by 10.142.80.10 with HTTP; Thu, 14 Jun 2007 05:47:09 -0700 (PDT) Message-ID: <162867790706140547s591ed956lb93972b686e74505@mail.gmail.com> Date: Thu, 14 Jun 2007 14:47:09 +0200 From: "Pavel Stehule" To: "Martijn van Oosterhout" , "Pavel Stehule" , "Ashish Karalkar" , pgsql-general@postgresql.org, pgsql-sql@postgresql.org Subject: Re: [SQL] function to find difference between in days between two dates In-Reply-To: <20070614122628.GB11436@svana.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <006101c7ae4c$ed7edbd0$170211ac@LIONKING.COM> <162867790706140000w478d4bds4a0a2f42a8666a26@mail.gmail.com> <20070614111403.GA11436@svana.org> <162867790706140454q5e08cff6n22ed5d58748949ed@mail.gmail.com> <20070614122628.GB11436@svana.org> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200706/844 X-Sequence-Number: 115667 > Hrm, yet Bruce mentions it in one of his documents. > > http://momjian.us/main/writings/pgsql/data_processing.pdf > > It may be undocumented, but it get a lot of hits on google :) > why google? look to pgsql/src/backend/utils/adt/date.c :-) Regards Pavel Stehule