pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Escape Quotes
6+ messages / 3 participants
[nested] [flat]

* Escape Quotes
@ 2001-05-11 01:11 Keith Gray <keith@heart.com.au>
  2001-05-11 02:34 ` Re: Escape Quotes Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 6+ messages in thread

From: Keith Gray @ 2001-05-11 01:11 UTC (permalink / raw)
  To: pgsql-sql

When using apostrophies the PostgreSQL string seems to like 
an escape character as follows:


	update client set code = 'O\'SHEA' where clientid = 2;


The ANSI-92 standard seems to suggest that this could/should 
be handled by 

<quote> ::= '
<quote symbol> ::= <quote><quote>

	update client set code = 'O''SHEA' where clientid = 2;


Is it possible to get/configure PostgreSQL to handle <quote><quote>
as <quote> within a dleimited string?


Keith Gray



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: Escape Quotes
  2001-05-11 01:11 Escape Quotes Keith Gray <keith@heart.com.au>
@ 2001-05-11 02:34 ` Tom Lane <tgl@sss.pgh.pa.us>
  2001-05-11 02:40   ` Re: Escape Quotes Keith Gray <keith@heart.com.au>
  0 siblings, 1 reply; 6+ messages in thread

From: Tom Lane @ 2001-05-11 02:34 UTC (permalink / raw)
  To: Keith Gray <keith@heart.com.au>; +Cc: pgsql-sql

Keith Gray <keith@heart.com.au> writes:
> Is it possible to get/configure PostgreSQL to handle <quote><quote>
> as <quote> within a dleimited string?

We already do.

regression=# select 'O''SHEA';
 ?column?
----------
 O'SHEA
(1 row)


			regards, tom lane



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: Escape Quotes
  2001-05-11 01:11 Escape Quotes Keith Gray <keith@heart.com.au>
  2001-05-11 02:34 ` Re: Escape Quotes Tom Lane <tgl@sss.pgh.pa.us>
@ 2001-05-11 02:40   ` Keith Gray <keith@heart.com.au>
  2001-05-11 02:38     ` Re: Escape Quotes Tom Lane <tgl@sss.pgh.pa.us>
  2001-05-11 03:17     ` Re: Escape Quotes Keith Gray <keith@heart.com.au>
  0 siblings, 2 replies; 6+ messages in thread

From: Keith Gray @ 2001-05-11 02:40 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-sql

Tom Lane wrote:
> 
> Keith Gray <keith@heart.com.au> writes:
> > Is it possible to get/configure PostgreSQL to handle <quote><quote>
> > as <quote> within a dleimited string?
> 
> We already do.
> 
> regression=# select 'O''SHEA';
>  ?column?
> ----------
>  O'SHEA
> (1 row)
> 
>                         regards, tom lane
Sorry,

This may be a problem in "ipgsql" then??
...or is it different in update from select?

Keith



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: Escape Quotes
  2001-05-11 01:11 Escape Quotes Keith Gray <keith@heart.com.au>
  2001-05-11 02:34 ` Re: Escape Quotes Tom Lane <tgl@sss.pgh.pa.us>
  2001-05-11 02:40   ` Re: Escape Quotes Keith Gray <keith@heart.com.au>
@ 2001-05-11 02:38     ` Tom Lane <tgl@sss.pgh.pa.us>
  1 sibling, 0 replies; 6+ messages in thread

From: Tom Lane @ 2001-05-11 02:38 UTC (permalink / raw)
  To: Keith Gray <keith@heart.com.au>; +Cc: pgsql-sql

Keith Gray <keith@heart.com.au> writes:
> This may be a problem in "ipgsql" then??

I guess.  What is that, anyway?

> ...or is it different in update from select?

Nope, a literal is a literal.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: Escape Quotes
  2001-05-11 01:11 Escape Quotes Keith Gray <keith@heart.com.au>
  2001-05-11 02:34 ` Re: Escape Quotes Tom Lane <tgl@sss.pgh.pa.us>
  2001-05-11 02:40   ` Re: Escape Quotes Keith Gray <keith@heart.com.au>
@ 2001-05-11 03:17     ` Keith Gray <keith@heart.com.au>
  2001-05-11 04:45       ` Re: Re: Escape Quotes Roberto Mello <rmello@cc.usu.edu>
  1 sibling, 1 reply; 6+ messages in thread

From: Keith Gray @ 2001-05-11 03:17 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; pgsql-sql

> > > Is it possible to get/configure PostgreSQL to handle <quote><quote>
> > > as <quote> within a delimited string?
> >
> > We already do.
> >
> 
> This may be a problem in "ipgsql" then??
> ...or is it different in update from select?


The problem is in ipqsql... 
it doesn't handle update, but does handle select.

Both work fine for psql (linux).


Keith.



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: Re: Escape Quotes
  2001-05-11 01:11 Escape Quotes Keith Gray <keith@heart.com.au>
  2001-05-11 02:34 ` Re: Escape Quotes Tom Lane <tgl@sss.pgh.pa.us>
  2001-05-11 02:40   ` Re: Escape Quotes Keith Gray <keith@heart.com.au>
  2001-05-11 03:17     ` Re: Escape Quotes Keith Gray <keith@heart.com.au>
@ 2001-05-11 04:45       ` Roberto Mello <rmello@cc.usu.edu>
  0 siblings, 0 replies; 6+ messages in thread

From: Roberto Mello @ 2001-05-11 04:45 UTC (permalink / raw)
  To: Keith Gray <keith@heart.com.au>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; pgsql-sql

On Fri, May 11, 2001 at 01:17:41PM +1000, Keith Gray wrote:
> 
> The problem is in ipqsql... 

	What the heck is ipsql??

	-Roberto
-- 
+----| http://fslc.usu.edu USU Free Software & GNU/Linux Club |------+
  Roberto Mello - Computer Science, USU - http://www.brasileiro.net 
       http://www.sdl.usu.edu - Space Dynamics Lab, Developer    
In Borland you are never bored!



^ permalink  raw  reply  [nested|flat] 6+ messages in thread


end of thread, other threads:[~2001-05-11 04:45 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-05-11 01:11 Escape Quotes Keith Gray <keith@heart.com.au>
2001-05-11 02:34 ` Tom Lane <tgl@sss.pgh.pa.us>
2001-05-11 02:40   ` Keith Gray <keith@heart.com.au>
2001-05-11 02:38     ` Tom Lane <tgl@sss.pgh.pa.us>
2001-05-11 03:17     ` Keith Gray <keith@heart.com.au>
2001-05-11 04:45       ` Roberto Mello <rmello@cc.usu.edu>

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