Received: from aventurine.sge.net (aventurine.sge.net [152.91.14.25]) by hub.org (8.9.3/8.9.3) with ESMTP id AAA36014 for ; Mon, 15 Nov 1999 00:29:44 -0500 (EST) (envelope-from G.MacMinn@nca.gov.au) Received: from cadmium.sge.net (cadmium.sge.net [152.91.9.5]) by aventurine.sge.net (8.9.3/8.9.3) with ESMTP id QAA10302 for ; Mon, 15 Nov 1999 16:29:42 +1100 (EST) Received: (from uucp@localhost) by cadmium.sge.net (8.9.3/8.9.3) id QAA25974 for ; Mon, 15 Nov 1999 16:29:41 +1100 (EST) Received: from nodnsquery(10.1.2.11) by cadmium.sge.net via smap (V5.0) id xma025927; Mon, 15 Nov 99 16:29:36 +1100 Received: from amber (amber-int2.sge.net [10.1.2.254]) by kryptonite.sge.net (8.9.3/8.9.3) with SMTP id QAA63699 for ; Mon, 15 Nov 1999 16:29:36 +1100 (EST) Message-Id: X-Mailer: Novell GroupWise 5.2 Date: Mon, 15 Nov 1999 16:28:19 +1100 From: "Gary MacMinn" To: pgsql-sql@postgreSQL.org Subject: Re: [SQL] how can tell if a column is a primary key? Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Disposition: inline Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by hub.org id AAA36403 Hello All, I'm trying to find out if PostgreSQL has a function like NVL that replaces null values with a default? I have a table with datetime fields, some of which are null. I'm trying to extract the date and time components with the date() and time() functions but the null values break these functions. If NVL is not there, could anyone suggest alternatives? TIA, Gary MacMinn ================ Table = test1 +----------------------------------+----------------------------------+-------+ | Field | Type | Length| +----------------------------------+----------------------------------+-------+ | t1 | text | var | | d1 | datetime | 8 | +----------------------------------+----------------------------------+-------+ Query : SELECT t1, date(d1) from test1; //The date() function breaks if the d1 field is not set.