Skip to content

Commit cc84163

Browse files
committed
Use SQL standard '' rather than \' in /contrib. Backpatch to 8.1.X.
1 parent 40a95aa commit cc84163

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

contrib/dbmirror/DBMirror.pl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
#
3434
#
3535
##############################################################################
36-
# $PostgreSQL: pgsql/contrib/dbmirror/DBMirror.pl,v 1.10 2004/07/02 00:58:09 joe Exp $
36+
# $PostgreSQL: pgsql/contrib/dbmirror/DBMirror.pl,v 1.11 2006/05/19 02:38:47 momjian Exp $
3737
#
3838
##############################################################################
3939

@@ -437,7 +437,7 @@ ($$$$$)
437437
if(defined $recordValues{$column}) {
438438
my $quotedValue = $recordValues{$column};
439439
$quotedValue =~ s/\\/\\\\/g;
440-
$quotedValue =~ s/'/\\'/g;
440+
$quotedValue =~ s/'/''/g;
441441
$valuesQuery .= "'$quotedValue'";
442442
}
443443
else {
@@ -617,7 +617,7 @@ ($$$$$)
617617
if(defined $currentValue ) {
618618
$quotedValue = $currentValue;
619619
$quotedValue =~ s/\\/\\\\/g;
620-
$quotedValue =~ s/'/\\'/g;
620+
$quotedValue =~ s/'/''/g;
621621
$updateQuery .= "'$quotedValue'";
622622
}
623623
else {
@@ -639,7 +639,7 @@ ($$$$$)
639639
if(defined $currentValue) {
640640
$quotedValue = $currentValue;
641641
$quotedValue =~ s/\\/\\\\/g;
642-
$quotedValue =~ s/'/\\'/g;
642+
$quotedValue =~ s/'/''/g;
643643
$updateQuery .= "'$quotedValue'";
644644
}
645645
else {

contrib/dbmirror/pending.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/****************************************************************************
22
* pending.c
3-
* $Id: pending.c,v 1.23 2005/10/15 02:49:04 momjian Exp $
4-
* $PostgreSQL: pgsql/contrib/dbmirror/pending.c,v 1.23 2005/10/15 02:49:04 momjian Exp $
3+
* $Id: pending.c,v 1.24 2006/05/19 02:38:47 momjian Exp $
4+
* $PostgreSQL: pgsql/contrib/dbmirror/pending.c,v 1.24 2006/05/19 02:38:47 momjian Exp $
55
*
66
* This file contains a trigger for Postgresql-7.x to record changes to tables
77
* to a pending table for mirroring.
@@ -541,7 +541,7 @@ packageData(HeapTuple tTupleData, TupleDesc tTupleDesc, Oid tableOid,
541541
}
542542
if (*cpUnFormatedPtr == '\\' || *cpUnFormatedPtr == '\'')
543543
{
544-
*cpFormatedPtr = '\\';
544+
*cpFormatedPtr = *cpUnFormatedPtr;
545545
cpFormatedPtr++;
546546
iUsedDataBlock++;
547547
}

contrib/tsearch2/query.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -748,7 +748,7 @@ infix(INFIX * in, bool first)
748748
{
749749
if ( t_iseq(op, '\'') )
750750
{
751-
*(in->cur) = '\\';
751+
*(in->cur) = '\'';
752752
in->cur++;
753753
}
754754
COPYCHAR(in->cur,op);

contrib/tsearch2/tsvector.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,7 @@ tsvector_out(PG_FUNCTION_ARGS)
529529

530530
outbuf = (char *) repalloc((void *) outbuf, ++lenbuf);
531531
curout = outbuf + pos;
532-
*curout++ = '\\';
532+
*curout++ = '\'';
533533
}
534534
while(len--)
535535
*curout++ = *curin++;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy