From gdaswani@esri.com Tue Oct 31 21:50:43 2000 Received: from esri2.esri.com (dwp.esri.com [198.102.62.250]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id e9VLohl08960; Tue, 31 Oct 2000 16:50:43 -0500 (EST) (envelope-from gdaswani@esri.com) Received: from narn (narn.esri.com [46.1.37.238]) by esri2.esri.com (8.8.8+Sun/8.8.8) with SMTP id NAA02363; Tue, 31 Oct 2000 13:49:52 -0800 (PST) Message-ID: <006e01c04384$e4bb2d30$ee25012e@narn> From: "George Henry C. Daswani" To: Cc: Subject: Problem with coalesce.. Date: Tue, 31 Oct 2000 13:52:41 -0800 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_006B_01C04341.D6768280" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 X-Archive-Number: 200010/84 X-Sequence-Number: 85 This is a multi-part message in MIME format. ------=_NextPart_000_006B_01C04341.D6768280 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hello, Was wondering if such a call is unsupported, or a bug? 7.0.2 (postgresql, linux redhat 7.0) SELECT COALESCE ((SELECT NULL,1)=20 returns a 1, correct.. however.. SELECT COALESCE ((SELECT CURVALUE FROM TABLEKEYS WHERE TABLENAME =3D 'BUYER= '),1) returns a "UNKNOWN expression type 501" SELECT CURVALUE FROM TABLEKEYS WHERE TABLENAME =3D 'BUYER'; returns a '0' Thanks.. George ------=_NextPart_000_006B_01C04341.D6768280 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hello,
 
    Was wondering if such a= call is=20 unsupported, or a bug?
 
7.0.2 (postgresql, linux redhat 7.0)
 
SELECT COALESCE ((SELECT NULL,1)
 
returns a 1, correct..
 
however..
 
SELECT COALESCE ((SELECT CURVALUE FROM TAB= LEKEYS=20 WHERE TABLENAME =3D 'BUYER'),1)
 
returns a "UNKNOWN expression type=20 501"
 
SELECT CURVALUE FROM TABLEKEYS WHERE TABLE= NAME =3D=20 'BUYER'; returns a '0'
 
Thanks..
 
George
 
 
------=_NextPart_000_006B_01C04341.D6768280-- From CTE@Dal.Ca Wed Nov 1 15:00:16 2000 Received: from Alex2.cte.Dal.Ca (Alex2.cte.Dal.Ca [134.190.17.62]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id eA1F0Gl61281 for ; Wed, 1 Nov 2000 10:00:16 -0500 (EST) (envelope-from CTE@Dal.Ca) Received: from ghost (Ghost.cte.Dal.Ca [134.190.17.89]) by Alex2.cte.Dal.Ca (8.9.3/8.9.3) with SMTP id LAA14981; Wed, 1 Nov 2000 11:15:49 -0400 Message-ID: <00a001c04414$997fd420$5911be86@cte.Dal.Ca> From: "Continuing Technical Education" To: "George Henry C. Daswani" Cc: "Pgsql-sql" References: <006e01c04384$e4bb2d30$ee25012e@narn> Subject: Re: Problem with coalesce.. Date: Wed, 1 Nov 2000 11:01:22 -0400 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_009D_01C043F3.123BD980" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 X-Archive-Number: 200011/6 X-Sequence-Number: 37 This is a multi-part message in MIME format. ------=_NextPart_000_009D_01C043F3.123BD980 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Try: SELECT COALESCE(CURVALUE,1) FROM TABLEKEYS WHERE TABLENAME =3D 'BUYER'; ----- Original Message -----=20 From: George Henry C. Daswani=20 To: pgsql-sql@postgresql.org=20 Cc: pgsql-general@postgresql.org=20 Sent: Tuesday, October 31, 2000 5:52 PM Subject: [SQL] Problem with coalesce.. Hello, Was wondering if such a call is unsupported, or a bug? 7.0.2 (postgresql, linux redhat 7.0) SELECT COALESCE ((SELECT NULL,1)=20 returns a 1, correct.. however.. SELECT COALESCE ((SELECT CURVALUE FROM TABLEKEYS WHERE TABLENAME =3D 'BUY= ER'),1) returns a "UNKNOWN expression type 501" SELECT CURVALUE FROM TABLEKEYS WHERE TABLENAME =3D 'BUYER'; returns a '0' Thanks.. George ------=_NextPart_000_009D_01C043F3.123BD980 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Try:
 
SELECT COALESCE(CURVALUE,1) FROM TABLEKEYS= WHERE=20 TABLENAME =3D 'BUYER';
 
----- Original Message -----
Fro= m:=20 George Hen= ry C.=20 Daswani
To: pgsql-sql@postgresql.org
Sent: Tuesday, October 31, 2000 5:= 52=20 PM
Subject: [SQL] Problem with=20 coalesce..

Hello,
 
    Was wondering if such= a call=20 is unsupported, or a bug?
 
7.0.2 (postgresql, linux redhat 7.0)
 
SELECT COALESCE ((SELECT NULL,1) =
 
returns a 1, correct..
 
however..
 
SELECT COALESCE ((SELECT CURVALUE FROM T= ABLEKEYS=20 WHERE TABLENAME =3D 'BUYER'),1)
 
returns a "UNKNOWN expression type=20 501"
 
SELECT CURVALUE FROM TABLEKEYS WHERE TAB= LENAME =3D=20 'BUYER'; returns a '0'
 
Thanks..
 
George
 
 
------=_NextPart_000_009D_01C043F3.123BD980-- From sszabo@megazone23.bigpanda.com Wed Nov 1 16:50:19 2000 Received: from megazone23.bigpanda.com (138.210.6.64.reflexcom.com [64.6.210.138]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id eA1GoJl74941; Wed, 1 Nov 2000 11:50:19 -0500 (EST) (envelope-from sszabo@megazone23.bigpanda.com) Received: from localhost (sszabo@localhost) by megazone23.bigpanda.com (8.11.0/8.11.0) with ESMTP id eA1Go6069315; Wed, 1 Nov 2000 08:50:07 -0800 (PST) Date: Wed, 1 Nov 2000 08:50:06 -0800 (PST) From: Stephan Szabo To: "George Henry C. Daswani" cc: pgsql-sql@postgresql.org, pgsql-general@postgresql.org Subject: Re: Problem with coalesce.. In-Reply-To: <006e01c04384$e4bb2d30$ee25012e@narn> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Archive-Number: 200011/23 X-Sequence-Number: 135 There are still some contexts in which subqueries in expressions are wierd. The example below appears to work in current sources however. Stephan Szabo sszabo@bigpanda.com On Tue, 31 Oct 2000, George Henry C. Daswani wrote: > Hello, > > Was wondering if such a call is unsupported, or a bug? > > 7.0.2 (postgresql, linux redhat 7.0) > > SELECT COALESCE ((SELECT NULL,1) > > returns a 1, correct.. > > however.. > > SELECT COALESCE ((SELECT CURVALUE FROM TABLEKEYS WHERE TABLENAME = 'BUYER'),1) > > returns a "UNKNOWN expression type 501" > > SELECT CURVALUE FROM TABLEKEYS WHERE TABLENAME = 'BUYER'; returns a '0' > > Thanks.. > > George > > > From tgl@sss.pgh.pa.us Thu Nov 2 08:09:34 2000 Received: from sss.pgh.pa.us (sss.pgh.pa.us [209.114.132.154]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id eA289Yl24010; Thu, 2 Nov 2000 03:09:34 -0500 (EST) (envelope-from tgl@sss.pgh.pa.us) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.11.1/8.11.1) with ESMTP id eA289A524583; Thu, 2 Nov 2000 03:09:10 -0500 (EST) To: Stephan Szabo cc: "George Henry C. Daswani" , pgsql-sql@postgresql.org, pgsql-general@postgresql.org Subject: Re: [SQL] Re: Problem with coalesce.. In-reply-to: References: Comments: In-reply-to Stephan Szabo message dated "Wed, 01 Nov 2000 08:50:06 -0800" Date: Thu, 02 Nov 2000 03:09:10 -0500 Message-ID: <24580.973152550@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200011/64 X-Sequence-Number: 176 Stephan Szabo writes: > There are still some contexts in which subqueries in expressions are > wierd. The example below appears to work in current sources however. >> SELECT COALESCE ((SELECT CURVALUE FROM TABLEKEYS WHERE TABLENAME = 'BUYER'),1) >> returns a "UNKNOWN expression type 501" AFAICT it works in 7.0.* as well. Are you sure this was 7.0.2, and not 6.5.something? regards, tom lane