Re: [SQL] string containing (')

From: Herouth Maoz <herouth(at)oumail(dot)openu(dot)ac(dot)il>
To: Brian Baquiran <brianb(at)evoserve(dot)com>, pgsql-sql(at)postgreSQL(dot)org
Subject: Re: [SQL] string containing (')
Date: 1999-03-22 12:35:12
Message-ID: l03110703b31be8bf8484@[147.233.148.111]
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

At 18:06 +0200 on 20/03/1999, Brian Baquiran wrote:

> >
> > > HI!
> > > Can anyone help,
> > > I want to store a string into a relation that might contain an apostrophe
> > > ('). Is there anyway around this or can I not store such strings.
> > > Thanks for your help
> >
> > '\''
>
> I've always thought the proper way was to use 2 quotes ('').

It is the proper way, as far as compatibility to standard SQL is concerned.
Both methods are supported by PostgreSQL, though.

I have a certain grievance against PostgreSQL and its escaping mechanism,
which makes scripts written in standard SQL produce wrong results if they
have backslashes in them.

Perhaps there should be a switch, SET COMPATIBILITY or something, which
disables incompatible parses from taking place, and allows using legacy
script with little concern for the content of the strings.

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 secret 1999-03-23 15:32:55 Simple Optimization Problem
Previous Message Peter Garner 1999-03-22 00:58:55 Re: [SQL] string containing (')