J
J
jrborisov2017-07-28 18:23:16
PostgreSQL
jrborisov, 2017-07-28 18:23:16

Why can't postgresql find spaces in a query with where?

There is such a query
SELECT region_id, name, url_name
FROM public.tbl_city
WHERE name = 'Brest region';
and as a result it finds nothing, but the record itself is there. if you search WHERE name = 'Brest'; then everything is fine

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander Tikhomirov, 2017-07-31
@SysNord

Is there a space at the end of the field value 'Brest region' by any chance?

X
x67, 2017-08-01
@x67

use TRIMto remove all spaces, commas and other extra characters

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question