Received: from news.tht.net (news.hub.org [216.126.91.242]) by postgresql.org (8.11.3/8.11.4) with ESMTP id f7F42pP39395 for ; Wed, 15 Aug 2001 00:02:51 -0400 (EDT) (envelope-from news@news.tht.net) Received: (from news@localhost) by news.tht.net (8.11.4/8.11.4) id f7F3oiY38590 for pgsql-sql@postgresql.org; Tue, 14 Aug 2001 23:50:44 -0400 (EDT) (envelope-from news) From: "Bill" X-Newsgroups: comp.databases.postgresql.sql Subject: Re: DateDiff, IsNull? Date: Wed, 15 Aug 2001 11:44:27 +0800 Organization: Hub.Org Networking Services (http://www.hub.org) Lines: 40 Message-ID: <9lcrij$15lk$2@news.tht.net> References: <9lb25o$psq$1@news.tht.net> X-Complaints-To: scrappy@hub.org X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 To: pgsql-sql@postgresql.org X-Archive-Number: 200108/201 X-Sequence-Number: 4433 IsNull work like this SELECT IsNull( user_name, '') FROM user ; then the query will return empty string when the field user_name is null Regards Bill > > Hello all, > > > > I am a newbie to postgreSQL, is it possible to write a "DateDiff", > > "IsNull" function work same as the one in SQL Server and are there and > > sample out there? And is it possible to override the existing function and > > operator like "+" to become a concate? > > I don't know what IsNull does but: > > template1=> select coalesce(NULL, 'Hello'); > case > ------- > Hello > (1 row) > > I do know what DateDiff does: > > template1=> select '2001-08-14'::date - '6 weeks'::interval; > ?column? > ------------------------ > 2001-07-03 00:00:00-05 > (1 row) > > Overloading operators? *Please* tell me that this is impossible. > > Alan Gutierrez