pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: postgresql <pgsql@symcom.com>
To: Megalex <megalex@klanomega.com>
To: pgsql-sql@postgresql.org
Subject: Re: problems with single quotes..
Date: Sun, 02 Dec 2001 16:48:11 -0500
Message-ID: <200112022135.fB2LZem43627@postgresql.org> (raw)
In-Reply-To: <000b01c07680$29fb2430$0301a8c0@klanomega.com>


> Insert Into table(userID,FirstName,LastName) values(1,'''\''','test')
I don't know if you have been able to figure out yet what you need but think of it 
this way:
    'Nick'    is a quoted word. let's form the possesive (nick's)
    'Nick\'s'  notice you still have the outside quotes. The slash is telling the system 
to ignore the single quote that directly follows it.

so what you want is:
INSERT INTO table (userID, FirstName, LastName) VALUES (1, 'william', 'L\'sale')
if you intend to have a single quote in the middle of a string (L'sale)

Ted

-----Original Message-----
From: "Megalex" <megalex@klanomega.com>
To: <pgsql-sql@postgresql.org>
Date: Thu, 4 Jan 2001 12:57:19 -0600
Subject: [SQL] problems with single quotes..

> ok.. here is my deal..
> 
> everytime i try to run an insert and my text contains '\'
> it fails..
> 
> an sql example would be.
> 
> Insert Into table(userID,FirstName,LastName) values(1,'''\''','test')
> and i get this message...
> 
> Error while executing the query; ERROR: parser: parse error at or near
> "test"
> 
> how can i fix this??
> 
> Alex,





view thread (12+ messages)  latest in thread

Message-ID: <200112022135.fB2LZem43627@postgresql.org>
Permalink:  ../200112022135.fB2LZem43627@postgresql.org/
Also on:    postgresql.org/message-id/200112022135.fB2LZem43627@postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: pgsql@symcom.com, megalex@klanomega.com
  Subject: Re: problems with single quotes..
  In-Reply-To: <200112022135.fB2LZem43627@postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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