Bug in char_length() in 7.0?

From: "Frank P(dot) Miles" <fpmi(at)home(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Bug in char_length() in 7.0?
Date: 2000-05-27 04:53:21
Message-ID: 392F54C1.C53946AB@home.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

char_length() no longer seems to be working for me (at least with my
current build).

For example, create a simple test table and populate it with some
values:

CREATE TABLE test (
f1 character(4) NOT NULL,
f2 varchar(20),
PRIMARY KEY (f1)
);

INSERT INTO test VALUES ('a', 'field a');
INSERT INTO test VALUES ('b', 'field b');
INSERT INTO test VALUES ('cc', 'field c');
INSERT INTO test VALUES ('dd', 'field d');
INSERT INTO test VALUES ('eee', 'field e');
INSERT INTO test VALUES ('fff', 'field f');
INSERT INTO test VALUES ('gggg', 'field g');
INSERT INTO test VALUES ('hhhh', 'field h');

Now use the selection:

SELECT * FROM test WHERE char_length(f1) = 2;

No results are returned. If the selection:

SELECT * FROM test WHERE char_length(f1) = 4;

is used, *all rows* are returned. Has the definition
of char_length been changed since 6.5.x? Is there
some other function to take its place?

Thanks...
-frank

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2000-05-27 05:49:55 Re: [GENERAL] SPI & file locations
Previous Message Tom Lane 2000-05-27 02:22:46 Re: SPI & file locations