and 8.0. Later releases already patched.
#
#
##############################################################################
-# $Id: DBMirror.pl,v 1.3.2.2 2002/12/05 21:04:14 momjian Exp $
+# $Id: DBMirror.pl,v 1.3.2.3 2006/05/21 19:56:40 momjian Exp $
#
##############################################################################
if(defined $recordValues{$column}) {
my $quotedValue = $recordValues{$column};
$quotedValue =~ s/\\/\\\\/g;
- $quotedValue =~ s/'/\\'/g;
+ $quotedValue =~ s/'/''/g;
$valuesQuery .= "'$quotedValue'";
}
else {
if(defined $currentValue ) {
$quotedValue = $currentValue;
$quotedValue =~ s/\\/\\\\/g;
- $quotedValue =~ s/'/\\'/g;
+ $quotedValue =~ s/'/''/g;
$updateQuery .= "'$quotedValue'";
}
else {
if(defined $currentValue) {
$quotedValue = $currentValue;
$quotedValue =~ s/\\/\\\\/g;
- $quotedValue =~ s/'/\\'/g;
+ $quotedValue =~ s/'/''/g;
$updateQuery .= "'$quotedValue'";
}
else {
/****************************************************************************
* pending.c
- * $Id: pending.c,v 1.6.2.5 2003/03/20 03:58:48 momjian Exp $
+ * $Id: pending.c,v 1.6.2.6 2006/05/21 19:56:40 momjian Exp $
*
* This file contains a trigger for Postgresql-7.x to record changes to tables
* to a pending table for mirroring.
}
if (*cpUnFormatedPtr == '\\' || *cpUnFormatedPtr == '\'')
{
- *cpFormatedPtr = '\\';
+ *cpFormatedPtr = *cpUnFormatedPtr;
cpFormatedPtr++;
iUsedDataBlock++;
}
'1' '2'
(1 row)
-SELECT '\'1 2\''::txtidx;
+SELECT '''1 2'''::txtidx;
txtidx
--------
'1 2'
(1 row)
-SELECT '\'1 \\\'2\''::txtidx;
+SELECT '''1 \\''2'''::txtidx;
txtidx
---------
'1 \'2'
(1 row)
-SELECT '\'1 \\\'2\'3'::txtidx;
+SELECT '''1 \\''2''3'::txtidx;
txtidx
-------------
'3' '1 \'2'
(1 row)
-SELECT '\'1 \\\'2\' 3'::txtidx;
+SELECT '''1 \\''2'' 3'::txtidx;
txtidx
-------------
'3' '1 \'2'
(1 row)
-SELECT '\'1 \\\'2\' \' 3\' 4 '::txtidx;
+SELECT '''1 \\''2'' '' 3'' 4 '::txtidx;
txtidx
------------------
'4' ' 3' '1 \'2'
'1'
(1 row)
-SELECT '\'1 2\''::query_txt;
+SELECT '''1 2'''::query_txt;
query_txt
-----------
'1 2'
(1 row)
-SELECT '\'1 \\\'2\''::query_txt;
+SELECT '''1 \\''2'''::query_txt;
query_txt
-----------
'1 \'2'
'1' & '2' & '4' & ( '5' | !'6' )
(1 row)
-SELECT '1&(\'2\'&(\' 4\'&(\\|5 | \'6 \\\' !|&\')))'::query_txt;
+SELECT '1&(''2''&('' 4''&(\\|5 | ''6 \\'' !|&'')))'::query_txt;
query_txt
------------------------------------------
'1' & '2' & ' 4' & ( '|5' | '6 \' !|&' )
'1'
(1 row)
-SELECT '\'1 2\''::mquery_txt;
+SELECT '''1 2'''::mquery_txt;
mquery_txt
------------
'1' & '2'
(1 row)
-SELECT '\'1 \\\'2\''::mquery_txt;
+SELECT '''1 \\''2'''::mquery_txt;
mquery_txt
------------
'1' & '2'
'1' & '2' & '4' & ( '5' | !'6' )
(1 row)
-SELECT '1&(\'2\'&(\' 4\'&(\\|5 | \'6 \\\' !|&\')))'::mquery_txt;
+SELECT '1&(''2''&('' 4''&(\\|5 | ''6 \\'' !|&'')))'::mquery_txt;
mquery_txt
---------------------------------
'1' & '2' & '4' & ( '5' | '6' )
11
(1 row)
-SELECT txt2txtidx('345 qwe@efd.r \' http://www.com/ http://aew.werc.ewr/?ad=qwe&dw 1aew.werc.ewr/?ad=qwe&dw 2aew.werc.ewr http://3aew.werc.ewr/?ad=qwe&dw http://4aew.werc.ewr http://5aew.werc.ewr:8100/? ad=qwe&dw 6aew.werc.ewr:8100/?ad=qwe&dw 7aew.werc.ewr:8100/?ad=qwe&dw=%20%32 +4.0e-10 qwe qwe qwqwe 234.435 455 5.005 teodor@stack.net qwe-wer asdf <fr>qwer jf sdjk<we hjwer <werrwe> ewr1> ewri2 <a href="qwe<qwe>">
+SELECT txt2txtidx('345 qwe@efd.r '' http://www.com/ http://aew.werc.ewr/?ad=qwe&dw 1aew.werc.ewr/?ad=qwe&dw 2aew.werc.ewr http://3aew.werc.ewr/?ad=qwe&dw http://4aew.werc.ewr http://5aew.werc.ewr:8100/? ad=qwe&dw 6aew.werc.ewr:8100/?ad=qwe&dw 7aew.werc.ewr:8100/?ad=qwe&dw=%20%32 +4.0e-10 qwe qwe qwqwe 234.435 455 5.005 teodor@stack.net qwe-wer asdf <fr>qwer jf sdjk<we hjwer <werrwe> ewr1> ewri2 <a href="qwe<qwe>">
/usr/local/fff /awdf/dwqe/4325 rewt/ewr wefjn /wqe-324/ewr gist.h gist.h.c gist.c. readline 4.2 4.2. 4.2, readline-4.2 readline-4.2. 234
<i <b> wow < jqw <> qwerty');
txt2txtidx
2
(1 row)
-SELECT txtidxsize(txt2txtidx('345 qwe@efd.r \' http://www.com/ http://aew.werc.ewr/?ad=qwe&dw 1aew.werc.ewr/?ad=qwe&dw 2aew.werc.ewr http://3aew.werc.ewr/?ad=qwe&dw http://4aew.werc.ewr http://5aew.werc.ewr:8100/? ad=qwe&dw 6aew.werc.ewr:8100/?ad=qwe&dw 7aew.werc.ewr:8100/?ad=qwe&dw=%20%32 +4.0e-10 qwe qwe qwqwe 234.435 455 5.005 teodor@stack.net qwe-wer asdf <fr>qwer jf sdjk<we hjwer <werrwe> ewr1> ewri2 <a href="qwe<qwe>">
+SELECT txtidxsize(txt2txtidx('345 qwe@efd.r '' http://www.com/ http://aew.werc.ewr/?ad=qwe&dw 1aew.werc.ewr/?ad=qwe&dw 2aew.werc.ewr http://3aew.werc.ewr/?ad=qwe&dw http://4aew.werc.ewr http://5aew.werc.ewr:8100/? ad=qwe&dw 6aew.werc.ewr:8100/?ad=qwe&dw 7aew.werc.ewr:8100/?ad=qwe&dw=%20%32 +4.0e-10 qwe qwe qwqwe 234.435 455 5.005 teodor@stack.net qwe-wer asdf <fr>qwer jf sdjk<we hjwer <werrwe> ewr1> ewri2 <a href="qwe<qwe>">
/usr/local/fff /awdf/dwqe/4325 rewt/ewr wefjn /wqe-324/ewr gist.h gist.h.c gist.c. readline 4.2 4.2. 4.2, readline-4.2 readline-4.2. 234
<i <b> wow < jqw <> qwerty'));
txtidxsize
SELECT ' 1'::txtidx;
SELECT ' 1 '::txtidx;
SELECT '1 2'::txtidx;
-SELECT '\'1 2\''::txtidx;
-SELECT '\'1 \\\'2\''::txtidx;
-SELECT '\'1 \\\'2\'3'::txtidx;
-SELECT '\'1 \\\'2\' 3'::txtidx;
-SELECT '\'1 \\\'2\' \' 3\' 4 '::txtidx;
+SELECT '''1 2'''::txtidx;
+SELECT '''1 \\''2'''::txtidx;
+SELECT '''1 \\''2''3'::txtidx;
+SELECT '''1 \\''2'' 3'::txtidx;
+SELECT '''1 \\''2'' '' 3'' 4 '::txtidx;
--query_txt
SELECT '1'::query_txt;
SELECT '1 '::query_txt;
SELECT ' 1'::query_txt;
SELECT ' 1 '::query_txt;
-SELECT '\'1 2\''::query_txt;
-SELECT '\'1 \\\'2\''::query_txt;
+SELECT '''1 2'''::query_txt;
+SELECT '''1 \\''2'''::query_txt;
SELECT '!1'::query_txt;
SELECT '1|2'::query_txt;
SELECT '1|!2'::query_txt;
SELECT '1&2&4&5&6'::query_txt;
SELECT '1&(2&(4&(5|6)))'::query_txt;
SELECT '1&(2&(4&(5|!6)))'::query_txt;
-SELECT '1&(\'2\'&(\' 4\'&(\\|5 | \'6 \\\' !|&\')))'::query_txt;
+SELECT '1&(''2''&('' 4''&(\\|5 | ''6 \\'' !|&'')))'::query_txt;
SELECT '1'::mquery_txt;
SELECT '1 '::mquery_txt;
SELECT ' 1'::mquery_txt;
SELECT ' 1 '::mquery_txt;
-SELECT '\'1 2\''::mquery_txt;
-SELECT '\'1 \\\'2\''::mquery_txt;
+SELECT '''1 2'''::mquery_txt;
+SELECT '''1 \\''2'''::mquery_txt;
SELECT '!1'::mquery_txt;
SELECT '1|2'::mquery_txt;
SELECT '1|!2'::mquery_txt;
SELECT '1&2&4&5&6'::mquery_txt;
SELECT '1&(2&(4&(5|6)))'::mquery_txt;
SELECT '1&(2&(4&(5|!6)))'::mquery_txt;
-SELECT '1&(\'2\'&(\' 4\'&(\\|5 | \'6 \\\' !|&\')))'::mquery_txt;
+SELECT '1&(''2''&('' 4''&(\\|5 | ''6 \\'' !|&'')))'::mquery_txt;
SELECT 'querty-fgries | http://www.google.com/index.html | www.rambler.ru/index.shtml'::mquery_txt;
CREATE TABLE test_txtidx( t text, a txtidx );
SELECT count(*) FROM test_txtidx WHERE a ## '(eq&yt)|(wR&qh)';
SELECT count(*) FROM test_txtidx WHERE a ## '(eq|yt)&(wR|qh)';
-SELECT txt2txtidx('345 qwe@efd.r \' http://www.com/ http://aew.werc.ewr/?ad=qwe&dw 1aew.werc.ewr/?ad=qwe&dw 2aew.werc.ewr http://3aew.werc.ewr/?ad=qwe&dw http://4aew.werc.ewr http://5aew.werc.ewr:8100/? ad=qwe&dw 6aew.werc.ewr:8100/?ad=qwe&dw 7aew.werc.ewr:8100/?ad=qwe&dw=%20%32 +4.0e-10 qwe qwe qwqwe 234.435 455 5.005 teodor@stack.net qwe-wer asdf <fr>qwer jf sdjk<we hjwer <werrwe> ewr1> ewri2 <a href="qwe<qwe>">
+SELECT txt2txtidx('345 qwe@efd.r '' http://www.com/ http://aew.werc.ewr/?ad=qwe&dw 1aew.werc.ewr/?ad=qwe&dw 2aew.werc.ewr http://3aew.werc.ewr/?ad=qwe&dw http://4aew.werc.ewr http://5aew.werc.ewr:8100/? ad=qwe&dw 6aew.werc.ewr:8100/?ad=qwe&dw 7aew.werc.ewr:8100/?ad=qwe&dw=%20%32 +4.0e-10 qwe qwe qwqwe 234.435 455 5.005 teodor@stack.net qwe-wer asdf <fr>qwer jf sdjk<we hjwer <werrwe> ewr1> ewri2 <a href="qwe<qwe>">
/usr/local/fff /awdf/dwqe/4325 rewt/ewr wefjn /wqe-324/ewr gist.h gist.h.c gist.c. readline 4.2 4.2. 4.2, readline-4.2 readline-4.2. 234
<i <b> wow < jqw <> qwerty');
SELECT txtidxsize(txt2txtidx('345 qw'));
-SELECT txtidxsize(txt2txtidx('345 qwe@efd.r \' http://www.com/ http://aew.werc.ewr/?ad=qwe&dw 1aew.werc.ewr/?ad=qwe&dw 2aew.werc.ewr http://3aew.werc.ewr/?ad=qwe&dw http://4aew.werc.ewr http://5aew.werc.ewr:8100/? ad=qwe&dw 6aew.werc.ewr:8100/?ad=qwe&dw 7aew.werc.ewr:8100/?ad=qwe&dw=%20%32 +4.0e-10 qwe qwe qwqwe 234.435 455 5.005 teodor@stack.net qwe-wer asdf <fr>qwer jf sdjk<we hjwer <werrwe> ewr1> ewri2 <a href="qwe<qwe>">
+SELECT txtidxsize(txt2txtidx('345 qwe@efd.r '' http://www.com/ http://aew.werc.ewr/?ad=qwe&dw 1aew.werc.ewr/?ad=qwe&dw 2aew.werc.ewr http://3aew.werc.ewr/?ad=qwe&dw http://4aew.werc.ewr http://5aew.werc.ewr:8100/? ad=qwe&dw 6aew.werc.ewr:8100/?ad=qwe&dw 7aew.werc.ewr:8100/?ad=qwe&dw=%20%32 +4.0e-10 qwe qwe qwqwe 234.435 455 5.005 teodor@stack.net qwe-wer asdf <fr>qwer jf sdjk<we hjwer <werrwe> ewr1> ewri2 <a href="qwe<qwe>">
/usr/local/fff /awdf/dwqe/4325 rewt/ewr wefjn /wqe-324/ewr gist.h gist.h.c gist.c. readline 4.2 4.2. 4.2, readline-4.2 readline-4.2. 234
<i <b> wow < jqw <> qwerty'));
* back to source text
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/ruleutils.c,v 1.124.2.2 2003/10/02 22:25:08 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/ruleutils.c,v 1.124.2.3 2006/05/21 19:56:40 momjian Exp $
*
* This software is copyrighted by Jan Wieck - Hamburg.
*
if (ch == '\'' || ch == '\\')
{
- appendStringInfoChar(buf, '\\');
+ appendStringInfoChar(buf, ch);
appendStringInfoChar(buf, ch);
}
else if (((unsigned char) ch) < ((unsigned char) ' '))
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.305.2.12 2006/01/09 21:16:57 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.305.2.13 2006/05/21 19:56:40 momjian Exp $
*
*-------------------------------------------------------------------------
*/
for (s = tgargs; s < p;)
{
if (*s == '\'')
- appendPQExpBufferChar(query, '\\');
+ appendPQExpBufferChar(query, *s);
appendPQExpBufferChar(query, *s++);
}
appendPQExpBufferChar(query, '\'');
*
* Copyright 2000-2002 by PostgreSQL Global Development Group
*
- * $Header: /cvsroot/pgsql/src/bin/psql/large_obj.c,v 1.23 2002/10/15 02:24:16 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/bin/psql/large_obj.c,v 1.23.2.1 2006/05/21 19:56:40 momjian Exp $
*/
#include "postgres_fe.h"
#include "large_obj.h"
for (i = 0; i < slen; i++)
{
if (comment_arg[i] == '\'' || comment_arg[i] == '\\')
- *bufptr++ = '\\';
+ *bufptr++ = comment_arg[i];
*bufptr++ = comment_arg[i];
}
strcpy(bufptr, "')");
#
#
# IDENTIFICATION
-# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/createdb,v 1.28 2002/10/18 22:05:36 petere Exp $
+# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/createdb,v 1.28.2.1 2006/05/21 19:56:41 momjian Exp $
#
#-------------------------------------------------------------------------
# escape the quotes
-dbpath=`echo "$dbpath" | sed "s/'/\\\\\'/g"`
+dbpath=`echo "$dbpath" | sed "s/'/\'\'/g"`
dbname=`echo "$dbname" | sed 's/\"/\\\"/g'`
TEMPLATE=`echo "$TEMPLATE" | sed 's/\"/\"\"/g'`
# Insert comment as well, if requested
[ -z "$dbcomment" ] && exit 0
-dbcomment=`echo "$dbcomment" | sed "s/'/\\\\\'/g"`
+dbcomment=`echo "$dbcomment" | sed "s/'/\'\'/g"`
${PATHNAME}psql $PSQLOPT -d "$dbname" -c "SET autocommit TO 'on';COMMENT ON DATABASE \"$dbname\" IS '$dbcomment'"
if [ "$?" -ne 0 ]; then
exec sql execute immediate :command;
printf("New tuple got OID = %ld\n", sqlca.sqlerrd[1]);
- sprintf(command, "insert into \"Test\" (name, amount, letter) values ('db: \\\'mm\\\'', 2, 't')");
+ sprintf(command, "insert into \"Test\" (name, amount, letter) values ('db: ''mm''', 2, 't')");
exec sql execute immediate :command;
strcpy(msg, "execute insert 2");
import org.postgresql.largeobject.*;
import org.postgresql.util.*;
-/* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc1/Attic/AbstractJdbc1Statement.java,v 1.12.2.7 2003/08/07 17:56:27 barry Exp $
+/* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc1/Attic/AbstractJdbc1Statement.java,v 1.12.2.8 2006/05/21 19:56:41 momjian Exp $
* This class defines methods of the jdbc1 specification. This class is
* extended by org.postgresql.jdbc2.AbstractJdbc2Statement which adds the jdbc2
* methods. The real Statement class (for jdbc1) is org.postgresql.jdbc1.Jdbc1Statement
{
case '\\':
case '\'':
- p_output.append('\\');
+ p_output.append(c);
p_output.append(c);
break;
case '\0':
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-exec.c,v 1.122.2.1 2003/11/30 20:52:37 joe Exp $
+ * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-exec.c,v 1.122.2.2 2006/05/21 19:56:41 momjian Exp $
*
*-------------------------------------------------------------------------
*/
}
else if (*vp == '\'')
{
- rp[0] = '\\';
+ rp[0] = '\'';
rp[1] = '\'';
rp += 2;
}
print "-- same order as the columns of EMP."
print
print "CREATE FUNCTION new_emp() RETURNS EMP"
- print " AS 'SELECT \'None\'::text AS name,"
+ print " AS 'SELECT ''None''::text AS name,"
print " 1000 AS salary,"
print " 25 AS age,"
- print " \'none\'::varchar(16) AS dept'"
+ print " ''none''::varchar(16) AS dept'"
print " LANGUAGE 'sql'"
pgcnx.query("""CREATE FUNCTION new_emp() RETURNS EMP
- AS 'SELECT \\\'None\\\'::text AS name,
+ AS 'SELECT ''None''::text AS name,
1000 AS salary,
25 AS age,
- \\\'none\\\'::varchar(16) AS dept'
+ ''none''::varchar(16) AS dept'
LANGUAGE 'sql'""")
wait_key()
print
* procedural language
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/pl/plpgsql/src/gram.y,v 1.39.2.2 2005/02/08 18:22:45 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/pl/plpgsql/src/gram.y,v 1.39.2.3 2006/05/21 19:56:41 momjian Exp $
*
* This software is copyrighted by Jan Wieck - Hamburg.
*
while (*cp1 != '\0')
{
if (*cp1 == '\\' || *cp1 == '\'')
- *cp2++ = '\\';
+ *cp2++ = *cp1;
*cp2++ = *cp1++;
}
strcpy(cp2, "'::refcursor");
--
-- Copyright (c) 1994-5, Regents of the University of California
--
--- $Id: funcs.source,v 1.5 2001/10/26 20:45:33 tgl Exp $
+-- $Id: funcs.source,v 1.5.4.1 2006/05/21 19:56:41 momjian Exp $
--
---------------------------------------------------------------------------
-- columns of EMP.
CREATE FUNCTION new_emp() RETURNS EMP
- AS 'SELECT \'None\'::text AS name,
+ AS 'SELECT ''None''::text AS name,
1000 AS salary,
25 AS age,
- \'(2,2)\'::point AS cubicle'
+ ''(2,2)''::point AS cubicle'
LANGUAGE 'sql';
-- you can then project a column out of resulting the tuple by using the