pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Josh Berkus <josh@agliodbs.com>
To: Bill <bchie@opensys.com.hk>
Cc: pgsql-sql@postgresql.org
Subject: Re: DateDiff, IsNull?
Date: Tue, 14 Aug 2001 08:16:07 -0700
Message-ID: <web-101872@davinci.ethosmedia.com> (raw)
In-Reply-To: <9lb25o$psq$1@news.tht.net>

Bill,

>   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?

I take it that you want to do this to port an exisiting application?

If so, the DateDiff thing has already been covered in Roberto Mello's
"cookbook".

However, ISNULL, last I checked, was a Microsoft Access function and not
supported by MS SQL Server.  If you're porting from MS Access, you'll
need to fix a lot more of your SQL than the functions.  There is,
however, help for MS Access users:
(for both of the above)
http://techdocs.postgresql.org/

> And is it possible to override the existing
> function and
> operator like "+" to become a concate?

How's your C porgramming?  It's an open-source database, you can do
anything for which you have the skill and the time.  The advisability of
doing so, however, is another thing entirely ...

Given that all of the MS SQL Server "peculiarities" are not ANSI SQL
standard, have you given any thought to porting by search-and-replace
script instead of trying to make Postgres support a bunch of
non-standard operators and functions?  It'd be easier.

-Josh Berkus


______AGLIO DATABASE SOLUTIONS___________________________
                                       Josh Berkus
  Complete information technology      josh@agliodbs.com
   and data management solutions       (415) 565-7293
  for law firms, small businesses        fax 621-2533
    and non-profit organizations.      San Francisco







view thread (11+ messages)  latest in thread

Message-ID: <web-101872@davinci.ethosmedia.com>
Permalink:  ../web-101872@davinci.ethosmedia.com/
Also on:    postgresql.org/message-id/web-101872@davinci.ethosmedia.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: josh@agliodbs.com, bchie@opensys.com.hk
  Subject: Re: DateDiff, IsNull?
  In-Reply-To: <web-101872@davinci.ethosmedia.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox