Re: [SQL] ' escape

From: Herouth Maoz <herouth(at)oumail(dot)openu(dot)ac(dot)il>
To: pgsql-sql(at)postgreSQL(dot)org
Subject: Re: [SQL] ' escape
Date: 1998-12-08 09:45:18
Message-ID: l03110700b292a3705f91@[147.233.159.109]
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

At 11:27 +0200 on 8/12/98, Jan Wieck wrote:

>
> But
>
> create table ... default 'x\'\'y');
>
> does. Whenever something around quotes doesn't work, I first
> try to double them.

Nevertheless, it is a bug. You should double your quotes when they are
inside other quotes. When surrounded by doubled quotes, you have to
quadruple them. Or to escape them and escape the escapes. The following
also works:

testing=> CREATE TABLE test1
testing-> (
testing-> id int,
testing-> name varchar(128) default 'something with \\'' in it'
testing-> );

But it shouldn't, because it is only surrounded by single unescaped quotes.
If this string is used in any other context, it will have a single slash
and a single quote in it. Something is amiss.

Herouth

--
Herouth Maoz, Internet developer.
Open University of Israel - Telem project
http://telem.openu.ac.il/~herutma

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Petter Reinholdtsen 1998-12-08 11:54:44 Oracle SQL 'comment on ...'
Previous Message Jan Wieck 1998-12-08 09:27:16 Re: [SQL] ' escape