]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Use SQL standard '' rather than \' in /contrib. Backpatch to 8.1.X.
authorBruce Momjian <bruce@momjian.us>
Fri, 19 May 2006 02:39:04 +0000 (02:39 +0000)
committerBruce Momjian <bruce@momjian.us>
Fri, 19 May 2006 02:39:04 +0000 (02:39 +0000)
contrib/dbmirror/DBMirror.pl
contrib/dbmirror/pending.c
contrib/earthdistance/earthdistance.sql.in
contrib/tsearch2/query.c
contrib/tsearch2/tsvector.c

index 63b009b68fc2f3148dc6942fb280c90be2cc8170..345a250e1e0e4543b40a14fe72516d6970b279c7 100755 (executable)
@@ -33,7 +33,7 @@
 # 
 #
 ##############################################################################
-# $PostgreSQL: pgsql/contrib/dbmirror/DBMirror.pl,v 1.10 2004/07/02 00:58:09 joe Exp $ 
+# $PostgreSQL: pgsql/contrib/dbmirror/DBMirror.pl,v 1.10.6.1 2006/05/19 02:39:04 momjian Exp $ 
 #
 ##############################################################################
 
@@ -437,7 +437,7 @@ sub mirrorInsert($$$$$) {
       if(defined $recordValues{$column}) {
        my $quotedValue = $recordValues{$column};
        $quotedValue =~ s/\\/\\\\/g;
-       $quotedValue =~ s/'/\\'/g;
+       $quotedValue =~ s/'/''/g;
        $valuesQuery .= "'$quotedValue'";
       }
       else {
@@ -617,7 +617,7 @@ sub mirrorUpdate($$$$$) {
       if(defined $currentValue ) {
        $quotedValue = $currentValue;
        $quotedValue =~ s/\\/\\\\/g;
-       $quotedValue =~ s/'/\\'/g;
+       $quotedValue =~ s/'/''/g;
        $updateQuery .= "'$quotedValue'";
        }
       else {
@@ -639,7 +639,7 @@ sub mirrorUpdate($$$$$) {
       if(defined $currentValue) {
        $quotedValue = $currentValue;
        $quotedValue =~ s/\\/\\\\/g;
-        $quotedValue =~ s/'/\\'/g;
+        $quotedValue =~ s/'/''/g;
        $updateQuery .= "'$quotedValue'";
       }
       else {
index f0204f73aaa31ec08929a032e95830357cfa412b..26381b01fe0a5cd82f2c0fd3da2e4dacb5c3809f 100644 (file)
@@ -1,7 +1,7 @@
 /****************************************************************************
  * pending.c
- * $Id: pending.c,v 1.23 2005/10/15 02:49:04 momjian Exp $
- * $PostgreSQL: pgsql/contrib/dbmirror/pending.c,v 1.23 2005/10/15 02:49:04 momjian Exp $
+ * $Id: pending.c,v 1.23.2.1 2006/05/19 02:39:04 momjian Exp $
+ * $PostgreSQL: pgsql/contrib/dbmirror/pending.c,v 1.23.2.1 2006/05/19 02:39:04 momjian Exp $
  *
  * This file contains a trigger for Postgresql-7.x to record changes to tables
  * to a pending table for mirroring.
@@ -541,7 +541,7 @@ packageData(HeapTuple tTupleData, TupleDesc tTupleDesc, Oid tableOid,
                        }
                        if (*cpUnFormatedPtr == '\\' || *cpUnFormatedPtr == '\'')
                        {
-                               *cpFormatedPtr = '\\';
+                               *cpFormatedPtr = *cpUnFormatedPtr;
                                cpFormatedPtr++;
                                iUsedDataBlock++;
                        }
index b5de753443417122e2642aafbefa39b4f7d042ae..4a08cd93694f1eb341d22b72fce860a88b265504 100644 (file)
@@ -9,7 +9,7 @@ SET search_path = public;
 
 CREATE OR REPLACE FUNCTION earth() RETURNS float8
 LANGUAGE 'sql' IMMUTABLE
-AS 'SELECT \'6378168\'::float8';
+AS 'SELECT ''6378168''::float8';
 
 -- Astromers may want to change the earth function so that distances will be
 -- returned in degrees. To do this comment out the above definition and
index 0a1805e0e754b47cac682e701fa4eb302e2e6379..10da22c035f01a3438990ffbf4af14082a511044 100644 (file)
@@ -723,7 +723,7 @@ infix(INFIX * in, bool first)
                {
                        if (*op == '\'')
                        {
-                               *(in->cur) = '\\';
+                               *(in->cur) = '\'';
                                in->cur++;
                        }
                        *(in->cur) = *op;
index cfed6e428a3b1de23c002406326f7318eb41478a..38770dd61c97cb69a4376057407aba35d1aa9720 100644 (file)
@@ -526,7 +526,7 @@ tsvector_out(PG_FUNCTION_ARGS)
 
                                outbuf = (char *) repalloc((void *) outbuf, ++lenbuf);
                                curout = outbuf + pos;
-                               *curout++ = '\\';
+                               *curout++ = '\'';
                        }
                        *curout++ = *curin++;
                }