pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kumar <sgnerd@yahoo.com.sg>
To: psql <pgsql-sql@postgresql.org>
Subject: ::text problem
Date: Tue, 25 Nov 2003 18:07:58 +0530
Message-ID: <037f01c3b350$fa38ae00$7502a8c0@hdsc.com> (raw)

Hi ,

I am running postgres 7.3.4 on Linux 7.2. I wanna print 'Not Supplied' if 'c1' column of datatype - 'timestamp' is null. For that I am using case statement

SELECT 
    CASE WHEN c1 IS NULL THEN 'Record_Not_Found'ELSE c1 END as approval_date
FROM  t1;
ERROR:  Bad timestamp external representation 'Record_Not_Found' 


SELECT 
    CASE WHEN c1 IS NULL THEN 'Record_Not_Found'::text ELSE c1 END as approval_date
FROM  t1;
ERROR:  CASE types 'timestamp without time zone' and 'text' not matched


Where I am doing wrong? Please shed some light.

Regards
Senthil Kumar S
DBA

view thread (3+ messages)  latest in thread

Message-ID: <037f01c3b350$fa38ae00$7502a8c0@hdsc.com>
Permalink:  ../037f01c3b350$fa38ae00$7502a8c0@hdsc.com/
Also on:    postgresql.org/message-id/037f01c3b350$fa38ae00$7502a8c0@hdsc.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: sgnerd@yahoo.com.sg
  Subject: Re: ::text problem
  In-Reply-To: <037f01c3b350$fa38ae00$7502a8c0@hdsc.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