Help please - completely baffled by quoting - Mailing list pgsql-general

From Tim Robinson
Subject Help please - completely baffled by quoting
Date
Msg-id 006101c456c3$d4932100$0200a8c0@bart
Whole thread Raw
Responses Re: Help please - completely baffled by quoting
List pgsql-general
Hi,

I generally consider myself competent with the complexities of quoting but I
can't figure out postgres at all. I've read the manual and it looks very
straightforward but that doesn't accord with my experiences. Here's an
example:

    create table temp (a varchar(50));
    insert into temp values 'a\'b';
    insert into temp values 'a\\b';
    insert into temp values 'a\\\'b';

select * from temp returns
    a'b
    a\b
    a\'b

so far so good but what about this:

    select * from temp where a like 'a\\\'%'

this should return all strings starting with a\' but it returns nothing!!!

I would expect that these two

    select * from temp where a like 'a\\\'b'
    select * from temp where a = 'a\\\'b'

should return the same thing. The second one works as expected, but the
first one doesn't return anything.

I'm sure I'm missing something obvious. Thanks in advance for any help.

--- Tim



pgsql-general by date:

Previous
From: "NTPT"
Date:
Subject: Relocation error pg_dumpall undefined symbol get_progname in 7.4.3
Next
From: Peter Eisentraut
Date:
Subject: Re: Help please - completely baffled by quoting