pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: David Johnston <polobo@yahoo.com>
To: John Fabiani <johnf@jfcomputer.com>
Cc: pgsql-sql@postgresql.org <pgsql-sql@postgresql.org>
Subject: Re: the use of $$string$$
Date: Fri, 4 Nov 2011 12:05:19 -0400
Message-ID: <5B6EF5E5-F941-4D32-AF03-6BBCD6E83769@yahoo.com> (raw)
In-Reply-To: <201111040826.16177.johnf@jfcomputer.com>
References: <201111040738.29303.johnf@jfcomputer.com>
	<201111040826.16177.johnf@jfcomputer.com>

On Nov 4, 2011, at 11:26, John Fabiani <johnf@jfcomputer.com> wrote:

> On Friday, November 04, 2011 07:38:29 am John Fabiani wrote:
>> Hi,
>> I just discovered that I can use $$string$$ to account for the problem of
>> single quotes in the string (or other strange char's).  However, I noticed
>> that the table field contained E'string'.  I actually tried to find info on
>> this but I did not find anything.
>> 
>> Could someone explain what it means or better provide a web link for me to
>> discover the info.
>> 
>> Thanks in advance,
>> Johnf
> 
> 
> Thank you both for the quick replies and the links.  
> 
> What I still do not understand (I'm a little slow) is the fact that pgadmin3 
> showed the data as E'string'.  So I'm wondering if the data is now different 
> in the sense that I need use the 'E' in the field.
> 
> For example I have the last name of O'Reilly
> the field lname now appears to contain E'O'Reilly'
> 
> So will the normal select statements work;
> 
> Select * from table where lname = 'O'' Reilly'
> Select * from table where lname like 'O%'
> 
> or will I need to know the data contains the "E"  and add the 'E' to the sql 
> statements?
> 
> Thanks
> Johnf
> 
> 

Try it and see.

If, indeed, the E is part of the data you should fix your process.  Done correctly there should be no difference in the end result regardless of how you choose to identify your strings.

Don't use pgadmin3 myself so I don't know if what you are looking at would include the E.  If it is outputting DDL (I.e., INSERT statements) it might but simple SELECT results should not.

David J.


view thread (11+ messages)  latest in thread

Message-ID: <5B6EF5E5-F941-4D32-AF03-6BBCD6E83769@yahoo.com>
Permalink:  ../5B6EF5E5-F941-4D32-AF03-6BBCD6E83769@yahoo.com/
Also on:    postgresql.org/message-id/5B6EF5E5-F941-4D32-AF03-6BBCD6E83769@yahoo.com

 · 

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: polobo@yahoo.com, johnf@jfcomputer.com
  Subject: Re: the use of $$string$$
  In-Reply-To: <5B6EF5E5-F941-4D32-AF03-6BBCD6E83769@yahoo.com>

* 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