pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: speakeasy <nospam_artd@speakeasy.net>
Cc: pgsql-sql@postgresql.org
Subject: Re: View - Join based on dis-similar data types
Date: Wed, 12 Mar 2003 17:32:39 -0500
Message-ID: <29847.1047508359@sss.pgh.pa.us> (raw)
In-Reply-To: <gdacnSAwcOe6yvujXTWcoA@speakeasy.net>
References: <gdacnSAwcOe6yvujXTWcoA@speakeasy.net>

"speakeasy" <nospam_artd@speakeasy.net> 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



view thread (4+ messages)  latest in thread

Message-ID: <29847.1047508359@sss.pgh.pa.us>
Permalink:  ../29847.1047508359@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/29847.1047508359@sss.pgh.pa.us

 · 

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: tgl@sss.pgh.pa.us, nospam_artd@speakeasy.net
  Subject: Re: View - Join based on dis-similar data types
  In-Reply-To: <29847.1047508359@sss.pgh.pa.us>

* 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