Re: finding strings with quotes

From: Bosco Rama <postgres(at)boscorama(dot)com>
To: Christine Penner <chris(at)fp2(dot)ca>
Cc: Postgres-General <pgsql-general(at)postgresql(dot)org>
Subject: Re: finding strings with quotes
Date: 2011-02-25 22:36:46
Message-ID: 4D682EFE.2020208@boscorama.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Christine Penner wrote:
> I'm trying to do a select to find on a char field that has a single
> quote but getting errors. This is what I'm doing:
>
> Select * from f_buildings where B_STRET_LNE_CON='BERLETT\'S ROAD'

There are a couple of ways to do this in PG but the easiest and closest
to the standard is to use two quotes to insert a quote into a string.

Like this:
Select * from f_buildings where B_STRET_LNE_CON='BERLETT''S ROAD'

HTH

Bosco.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Gary Fu 2011-02-25 23:11:19 Re: slow building index and reference after Sybase to Pg
Previous Message Andy Colson 2011-02-25 22:22:53 Re: slow building index and reference after Sybase to Pg