Re: [GENERAL] Comparing a varchar of length > 32

2004-09-23 Thread Gaetano Mendola
Christian Enklaar wrote:
Hello,
we are using a table with a primary key of type varchar[50].
If we try to find entries with select * from  where  =
'';
entries with a key length of more than 32 characters are not found.
Entries with a shorter key are found. Using "Like" instead of "=" works for
varchar keys with length > 32 as well.
Does anybody know about this Problem ?
(We use PostgresQL 7.4.1)
I think you are hiding some informations.
It works here with a 7.4.5 and I'm not aware of any bug like this in previous
versions.
test=# \d test
Table "public.test"
 Column | Type  | Modifiers
+---+---
 a  | character varying(50) | not null
Indexes:
"test_pkey" primary key, btree (a)
test=# select a, length(a) from test;
 a  | length
+
 01234567890123456789012345678901234567890123   | 44
 0123456789012345678901234567890123456789   | 40
 01234567890123456789012345678901234567890123456789 | 50
(3 rows)
test=# select length(a) from test where a = 
'01234567890123456789012345678901234567890123';
 length

 44
(1 row)
Just an idea, could you reindex your table ?
Regards
Gaetano Mendola
---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]


Re: [GENERAL] Comparing a varchar of length > 32

2004-09-23 Thread Peter Eisentraut
Christian Enklaar wrote:
> we are using a table with a primary key of type varchar[50].
> If we try to find entries with select * from  where
>  = '';
> entries with a key length of more than 32 characters are not found.
> Entries with a shorter key are found. Using "Like" instead of "="
> works for varchar keys with length > 32 as well.

Please post the actual table definitions, the actual data, the actual 
command you are running, and the actual results you are getting.

-- 
Peter Eisentraut
http://developer.postgresql.org/~petere/


---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])


[GENERAL] Comparing a varchar of length > 32

2004-09-23 Thread Christian Enklaar
Hello,

we are using a table with a primary key of type varchar[50].
If we try to find entries with select * from  where  =
'';
entries with a key length of more than 32 characters are not found.
Entries with a shorter key are found. Using "Like" instead of "=" works for
varchar keys with length > 32 as well.

Does anybody know about this Problem ?
(We use PostgresQL 7.4.1)

Thanks in advance,
Christian Enklaar.





---(end of broadcast)---
TIP 9: the planner will ignore your desire to choose an index scan if your
  joining column's datatypes do not match