X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 16DB8D1CC81 for ; Tue, 25 Nov 2003 12:41:02 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 34873-02 for ; Tue, 25 Nov 2003 08:40:32 -0400 (AST) Received: from smtp005.mail.ukl.yahoo.com (smtp005.mail.ukl.yahoo.com [217.12.11.36]) by svr1.postgresql.org (Postfix) with SMTP id EA698D1B575 for ; Tue, 25 Nov 2003 08:40:28 -0400 (AST) Received: from unknown (HELO IVESIA67) (sgnerd@203.196.190.138 with login) by smtp1.mail.vip.ukl.yahoo.com with SMTP; 25 Nov 2003 12:40:30 -0000 Message-ID: <037f01c3b350$fa38ae00$7502a8c0@hdsc.com> Reply-To: "Kumar" From: "Kumar" To: "psql" Subject: ::text problem Date: Tue, 25 Nov 2003 18:07:58 +0530 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_037C_01C3B37F.0E8A0290" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=1.7 tagged_above=0.0 required=5.0 tests=HTML_40_50, UPPERCASE_25_50 X-Spam-Level: * X-Archive-Number: 200311/281 X-Sequence-Number: 16096 This is a multi-part message in MIME format. ------=_NextPart_000_037C_01C3B37F.0E8A0290 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable 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 stat= ement SELECT=20 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'=20 SELECT=20 CASE WHEN c1 IS NULL THEN 'Record_Not_Found'::text ELSE c1 END as appro= val_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 ------=_NextPart_000_037C_01C3B37F.0E8A0290 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi ,
 
I am running postgres 7.3.4 on Linux 7.2. I wanna = print=20 'Not Supplied' if 'c1' column of datatype - 'timestamp' is null. = For=20 that I am using case statement
 
SELECT
    CASE WHEN c1 IS NULL THEN=20 'Record_Not_Found'ELSE c1 END as approval_date
FROM  t1;
ERROR:  Bad timestamp external representation=20 'Record_Not_Found'
 
 
SELECT
    CASE WHEN c1 IS NULL THEN=20 'Record_Not_Found'::text ELSE c1 END as approval_date
FROM  t1;
ERROR:  CASE types 'timestamp without time zone' and 'text' not= =20 matched
 
 
Where I am doing wrong? Please shed some light.
 
Regards
Senthil Kumar S
DBA

------=_NextPart_000_037C_01C3B37F.0E8A0290--