pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedquotes etc
4+ messages / 4 participants
[nested] [flat]
* quotes etc
@ 2011-02-22 20:26 John Fabiani <johnf@jfcomputer.com>
0 siblings, 2 replies; 4+ messages in thread
From: John Fabiani @ 2011-02-22 20:26 UTC (permalink / raw)
To: pgsql-sql
Hi,
I would have thought that there would be a simple built-in function that would
escape the quotes as ('D' Andes') to ('D\' Andes'). But I did not see
anything?
I am I wrong?
Johnf
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: quotes etc
@ 2011-02-22 20:48 Kenneth Marshall <ktm@rice.edu>
parent: John Fabiani <johnf@jfcomputer.com>
1 sibling, 0 replies; 4+ messages in thread
From: Kenneth Marshall @ 2011-02-22 20:48 UTC (permalink / raw)
To: John Fabiani <johnf@jfcomputer.com>; +Cc: pgsql-sql
On Tue, Feb 22, 2011 at 12:26:41PM -0800, John Fabiani wrote:
> Hi,
> I would have thought that there would be a simple built-in function that would
> escape the quotes as ('D' Andes') to ('D\' Andes'). But I did not see
> anything?
>
> I am I wrong?
>
> Johnf
>
The manual goes over many permutations of the escape process and
what options can be used in each case. I would start there, because
for example, escaping a "'" in SQL uses two "'"s: i.e. 'D' Andes'
becomes 'D'' Andes' I think. Procedural languages and libpq can
offer many other options for escape processing.
Cheers,
Ken
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: quotes etc
@ 2011-02-22 21:18 Adrian Klaver <adrian.klaver@gmail.com>
parent: John Fabiani <johnf@jfcomputer.com>
1 sibling, 1 reply; 4+ messages in thread
From: Adrian Klaver @ 2011-02-22 21:18 UTC (permalink / raw)
To: pgsql-sql; +Cc: John Fabiani <johnf@jfcomputer.com>
On Tuesday, February 22, 2011 12:26:41 pm John Fabiani wrote:
> Hi,
> I would have thought that there would be a simple built-in function that
> would escape the quotes as ('D' Andes') to ('D\' Andes'). But I did not
> see anything?
>
> I am I wrong?
>
> Johnf
Dollar quoting ? :
http://www.postgresql.org/docs/9.0/interactive/sql-syntax-lexical.html
4.1.2.4. Dollar-Quoted String Constants
test(5432)aklaver=>SELECT $$D' Andes$$;
?column?
----------
D' Andes
--
Adrian Klaver
adrian.klaver@gmail.com
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: quotes etc
@ 2011-02-23 19:11 Emi Lu <emilu@encs.concordia.ca>
parent: Adrian Klaver <adrian.klaver@gmail.com>
0 siblings, 0 replies; 4+ messages in thread
From: Emi Lu @ 2011-02-23 19:11 UTC (permalink / raw)
To: pgsql-sql
On 02/22/2011 04:18 PM, Adrian Klaver wrote:
> On Tuesday, February 22, 2011 12:26:41 pm John Fabiani wrote:
>
> > Hi,
>
> > I would have thought that there would be a simple built-in function that
>
> > would escape the quotes as ('D' Andes') to ('D\' Andes'). But I did not
>
> > see anything?
>
> >
>
> > I am I wrong?
>
> >
>
> > Johnf
>
> Dollar quoting ? :
>
> http://www.postgresql.org/docs/9.0/interactive/sql-syntax-lexical.html
>
> 4.1.2.4. Dollar-Quoted String Constants
>
> test(5432)aklaver=>SELECT $$D' Andes$$;
>
> ?column?
>
> ----------
>
> D' Andes
I like this $str$....$str$ very much!
Vote for this!
--
Lu Ying
^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2011-02-23 19:11 UTC | newest]
Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2011-02-22 20:26 quotes etc John Fabiani <johnf@jfcomputer.com>
2011-02-22 20:48 ` Kenneth Marshall <ktm@rice.edu>
2011-02-22 21:18 ` Adrian Klaver <adrian.klaver@gmail.com>
2011-02-23 19:11 ` Emi Lu <emilu@encs.concordia.ca>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox