Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28]) by postgresql.org (8.11.3/8.11.1) with SMTP id f4D0reA44122 for ; Sat, 12 May 2001 20:53:40 -0400 (EDT) (envelope-from pgsql-sql-owner@postgresql.org) Received: from news.tht.net (news.hub.org [216.126.91.242]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f4CJR3A40780 for ; Sat, 12 May 2001 15:27:03 -0400 (EDT) (envelope-from news@news.tht.net) Received: (from news@localhost) by news.tht.net (8.11.1/8.11.1) id f4CJNBC07031 for pgsql-sql@postgresql.org; Sat, 12 May 2001 15:23:11 -0400 (EDT) (envelope-from news) From: =?iso-8859-1?Q?Hans=2DJ=FCrgen=20Sch=F6nig?= X-Newsgroups: comp.databases.postgresql.sql Subject: SELECT timestamp('2001-06-12'::date - '2000-06-12'::date) Date: Sat, 12 May 2001 21:26:45 +0200 Organization: Hub.Org Networking Services (http://www.hub.org) Lines: 20 Message-ID: <3AFD8E75.A1E5115B@cybertec.at> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: scrappy@hub.org X-Mailer: Mozilla 4.77 [de] (X11; U; Linux 2.4.2-2 i686) X-Accept-Language: en To: pgsql-sql@postgresql.org X-Archive-Number: 200105/113 X-Sequence-Number: 2929 The "+" operator is not defined for (date, date) which seems very logical to me since adding dates does in my opinion not make sense. performance=# SELECT timestamp('2001-06-12'::date + '2000-06-12'::date); ERROR: Unable to identify an operator '+' for types 'date' and 'date' You will have to retype this query using an explicit cast Surprisingly "-" is defined for (date, date). performance=# SELECT timestamp('2001-06-12'::date - '2000-06-12'::date); timestamp ------------------------ 1970-01-01 01:06:05+01 (1 row) Does anybody understand the logic behind that operation and why is the result not something like 1970-01-01 00:00:00? Hans