string cast/compare broken?

From: Scott Royston <scroyston(at)mac(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: string cast/compare broken?
Date: 2002-07-11 21:47:39
Message-ID: D217A228-9517-11D6-BBE3-000393577144@mac.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Mac OS X:
postgres% psql --version
psql (PostgreSQL) 7.2.1
contains support for: multibyte

LEDEV=# create table test1 (foo varchar(5));
CREATE
LEDEV=# create table test2 (foo char(5));
CREATE
LEDEV=# insert into test2 (foo) values ('S');
INSERT 3724249 1
LEDEV=# insert into test1 (foo) values ('S');
INSERT 3724250 1
LEDEV=# select a.foo, b.foo from test1 a, test2 b where a.foo =
b.foo::text;
foo | foo
-----+-----
(0 rows)

LEDEV=# select a.foo = 'S', b.foo = 'S' from test1 a, test2 b;
?column? | ?column?
----------+----------
t | t
(1 row)

LEDEV=# select a.foo, b.foo from test1 a, test2 b where CAST(a.foo as
CHAR) = b.foo;
foo | foo
-----+-------
S | S
(1 row)

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Roderick A. Anderson 2002-07-11 21:48:22 Re: Jan's Name (Was: Re: I am being interviewed by OReilly)
Previous Message Hannu Krosing 2002-07-11 21:20:39 Re: [pgaccess-users] RE: [HACKERS] bugzilla.pgaccess.org