Srinivas Iyyer wrote:
> In one of my tables, the varchar data includes
>I populated tables by introducing \ in front of '
>I am using R to query and analyze the data and it is
>turning out to be a problem to get a character vector
>in R to have the output like this:
>somehow it always provides me
>The above query with two \\ does not work in postgres.
>I tried a variety of tricks in R to get to what I want
>that suits postgres. No luck.
>so I decided to substitute where ever I find instances
>of ' (i.e: 3', 10', esterase's etc) to "prime".
>Eg: 3prime, 10prime, esterasesprimes.
>I have all my data in table gobe. I dont know how many
>rows have ' character.
>how can I substitute ' with prime in the whole table.
>BTW, is this a good way to solve the problem. For
>instance bioinformatics people who are dealing with GO
>terms, how are they approaching this problem.
A better solution might be to use $_$ instead of ' to quote strings. If
you use $_$, you don't need to escape '.
# select $_$Foo'bar$_$;
Note that you can use any sequence of alphabetical characters or
underscores to do quotes- so
is the quoted string $_$'$_$.
In response to
pgsql-novice by date
|Next:||From: Cyrus Downey||Date: 2006-08-22 17:58:08|
|Subject: Re: problem with single quote : ' [VASCL:A111C2C2718]|
|Previous:||From: Jasbinder Bali||Date: 2006-08-22 17:48:06|
|Subject: Passing Arguments to a trigger function(Problem)|