1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-13 07:41:39 +03:00

Use SQL standard '' rather than \' in /contrib. Backpatch to 8.1.X.

This commit is contained in:
Bruce Momjian
2006-05-19 02:39:04 +00:00
parent 1c01a5108a
commit 9a27f72b37
5 changed files with 10 additions and 10 deletions

View File

@ -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 {

View 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++;
}

View 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

View File

@ -723,7 +723,7 @@ infix(INFIX * in, bool first)
{
if (*op == '\'')
{
*(in->cur) = '\\';
*(in->cur) = '\'';
in->cur++;
}
*(in->cur) = *op;

View File

@ -526,7 +526,7 @@ tsvector_out(PG_FUNCTION_ARGS)
outbuf = (char *) repalloc((void *) outbuf, ++lenbuf);
curout = outbuf + pos;
*curout++ = '\\';
*curout++ = '\'';
}
*curout++ = *curin++;
}