Re: Problems with question marks in operators (JDBC, ECPG, ...)

From: Mike Blackwell <mike(dot)blackwell(at)rrd(dot)com>
To: Bruno Harbulot <bruno(at)distributedmatter(dot)net>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Kevin Grittner <kgrittn(at)ymail(dot)com>, "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, Greg Sabino Mullane <greg(at)turnstep(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Problems with question marks in operators (JDBC, ECPG, ...)
Date: 2015-05-19 18:51:58
Message-ID: CANPAkgu9rAOMXtDUsxbW8xRf6rvoZ3t0=hgRapc1+ZfWqo04ow@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

​Ah. I see. Thanks for the clarification.​

__________________________________________________________________________________
*Mike Blackwell | Technical Analyst, Distribution Services/Rollout
Management | RR Donnelley*
1750 Wallace Ave | St Charles, IL 60174-3401
Office: 630.313.7818
Mike(dot)Blackwell(at)rrd(dot)com
http://www.rrdonnelley.com

<http://www.rrdonnelley.com/>
* <Mike(dot)Blackwell(at)rrd(dot)com>*

On Tue, May 19, 2015 at 1:44 PM, Bruno Harbulot <bruno(at)distributedmatter(dot)net
> wrote:

>
>
> On Tue, May 19, 2015 at 7:22 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
>> Mike Blackwell <mike(dot)blackwell(at)rrd(dot)com> writes:
>> > See for example
>> > http://docs.oracle.com/cd/B19306_01/text.102/b14218/cqoper.htm#i997330,
>> > Table 3-1, third row, showing the precedence of '?'. Further down the
>> > page, under "Fuzzy" see "Backward Compatibility Syntax".
>>
>> If I'm reading that right, that isn't a SQL-level operator but an operator
>> in their text search query language, which would only appear in SQL
>> queries within string literals (compare tsquery's query operators in PG).
>> So it wouldn't be a hazard for ?-substitution, as long as the substituter
>> was bright enough to not change string literals.
>>
>> regards, tom lane
>>
>
> That's how I read it too. I've tried this little test:
> http://sqlfiddle.com/#!4/7436b/4/0
>
> CREATE TABLE test_table (
> id INTEGER PRIMARY KEY,
> name VARCHAR(100)
> );
>
> INSERT INTO test_table (id, name) VALUES (1, 'Nicole');
> INSERT INTO test_table (id, name) VALUES (2, 'Nicholas');
> INSERT INTO test_table (id, name) VALUES (3, 'Robert');
> INSERT INTO test_table (id, name) VALUES (4, 'Michael');
> INSERT INTO test_table (id, name) VALUES (5, 'Nicola');
>
> CREATE INDEX idx_test_table_name ON test_table(name) INDEXTYPE IS
> CTXSYS.CONTEXT;
>
> SELECT * FROM test_table WHERE CONTAINS(name, '?Nicolas', 1) > 0;
>
>
> Fuzzy matching works indeed, but the question mark is part of the literal
> (similarly to % when using LIKE).
>
> Best wishes,
>
> Bruno.
>
>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2015-05-19 19:00:13 Re: RFC: Non-user-resettable SET SESSION AUTHORISATION
Previous Message Greg Sabino Mullane 2015-05-19 18:51:31 Re: Problems with question marks in operators (JDBC, ECPG, ...)