Skip site navigation (1) Skip section navigation (2)

problem with select where like ']'

From: hubert depesz lubaczewski <depesz(at)depesz(dot)pl>
To: PGSQL-SQL <pgsql-sql(at)postgresql(dot)org>
Subject: problem with select where like ']'
Date: 2000-10-17 19:02:51
Message-ID: 20001017210251.A4327@cyber.cs.net.pl (view raw or flat)
Thread:
Lists: pgsql-sql
hi,
i have a table (view actually) which contains field "article_name" which is
written like:
[AGD]|[Kuchenki Mikrofalowe]|[Samsung AKMS1]
i.e. some string within "[]" delimited by "|"
i want to select all record that have "[AGD]|[" in front of them
so i tried 
select * from my_view where article_name like '[AGD]|[';
this doesn't work. no errors, but no tuples returned.
i checked that the problem is character ']'.
'[' works o.k. '|' - i guess works too. 
but inserting "]" makes the whole expression doesn't work
i tried escaping of it like
\], \\]
or even
\\\]
but none of these worked.
right now i'm using comparison:
where substring (...) = '...' and it works even with those "]" signs.
but i'm just wondering why like ']' doesn't work.
any ideas?

depesz

p.s. sorry for my english.

-- 
  hubert depesz lubaczewski <=--=> adres www usuniêty na pro¶bê Asi ¦l.
------------------------------------------------------------------------
     najwspanialsz± rzecz± jak± da³o nam nowoczesne spo³eczeñstwo,
      jest niesamowita wrêcz ³atwo¶æ unikania kontaktów z nim ...

Responses

pgsql-sql by date

Next:From: Peter MountDate: 2000-10-17 19:23:17
Subject: Re: JDBC Performance
Previous:From: Bernie HuangDate: 2000-10-17 18:53:42
Subject: Big Sub-select statement

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group