X-Original-To: pgsql-sql@postgresql.org Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by postgresql.org (Postfix) with ESMTP id 3E3E8476350 for ; Wed, 12 Mar 2003 17:32:38 -0500 (EST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.8/8.12.8) with ESMTP id h2CMWdub029848; Wed, 12 Mar 2003 17:32:40 -0500 (EST) To: "speakeasy" Cc: pgsql-sql@postgresql.org Subject: Re: View - Join based on dis-similar data types In-reply-to: References: Comments: In-reply-to "speakeasy" message dated "Wed, 05 Mar 2003 14:59:33 -0500" Date: Wed, 12 Mar 2003 17:32:39 -0500 Message-ID: <29847.1047508359@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200303/319 X-Sequence-Number: 12358 "speakeasy" writes: > I have a field defined as a character(50) data type, and the same field > stored in a transition table as a text type. > The view itself work based on the join, however sub-queries against the view > on that field do not return any data. You probably need to rtrim() the CHAR field so that the trailing blanks in it don't foul up the comparison to the TEXT field. Trailing blanks are considered insignificant in CHAR comparisons ... but not in TEXT comparisons. So, WHERE rtrim(charfield) = textfield should work. regards, tom lane