]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Change \' to '', for SQL standards compliance. Backpatch to 7.3, 7.4,
authorBruce Momjian <bruce@momjian.us>
Sun, 21 May 2006 19:56:41 +0000 (19:56 +0000)
committerBruce Momjian <bruce@momjian.us>
Sun, 21 May 2006 19:56:41 +0000 (19:56 +0000)
and 8.0.  Later releases already patched.

14 files changed:
contrib/dbmirror/DBMirror.pl
contrib/dbmirror/pending.c
contrib/tsearch/expected/tsearch.out
contrib/tsearch/sql/tsearch.sql
src/backend/utils/adt/ruleutils.c
src/bin/pg_dump/pg_dump.c
src/bin/psql/large_obj.c
src/bin/scripts/createdb
src/interfaces/ecpg/test/test1.pgc
src/interfaces/jdbc/org/postgresql/jdbc1/AbstractJdbc1Statement.java
src/interfaces/libpq/fe-exec.c
src/interfaces/python/tutorial/func.py
src/pl/plpgsql/src/gram.y
src/tutorial/funcs.source

index cf32511beb565f59945f09af0eebb415139411b0..14c8fec3a5e2b114687c2c59c278938a4de9e50f 100755 (executable)
@@ -33,7 +33,7 @@
 # 
 #
 ##############################################################################
-# $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 $ 
 #
 ##############################################################################
 
@@ -412,7 +412,7 @@ sub mirrorInsert($$$$$) {
       if(defined $recordValues{$column}) {
        my $quotedValue = $recordValues{$column};
        $quotedValue =~ s/\\/\\\\/g;
-       $quotedValue =~ s/'/\\'/g;
+       $quotedValue =~ s/'/''/g;
        $valuesQuery .= "'$quotedValue'";
       }
       else {
@@ -595,7 +595,7 @@ sub mirrorUpdate($$$$$) {
       if(defined $currentValue ) {
        $quotedValue = $currentValue;
        $quotedValue =~ s/\\/\\\\/g;
-       $quotedValue =~ s/'/\\'/g;
+       $quotedValue =~ s/'/''/g;
        $updateQuery .= "'$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 {
index 04f1371bd78de66d1ac1944eefde98c9dfd4799d..b360c1b5718bc779092a98c5369637b756958595 100644 (file)
@@ -1,6 +1,6 @@
 /****************************************************************************
  * 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.
@@ -478,7 +478,7 @@ packageData(HeapTuple tTupleData, TupleDesc tTupleDesc,
                        }
                        if (*cpUnFormatedPtr == '\\' || *cpUnFormatedPtr == '\'')
                        {
-                               *cpFormatedPtr = '\\';
+                               *cpFormatedPtr = *cpUnFormatedPtr;
                                cpFormatedPtr++;
                                iUsedDataBlock++;
                        }
index 91f28dd47d79b75445a168af99238899828cf8a3..3069042fb8ebd1cc2c9cf1c7fd24d21f7d76ba60 100644 (file)
@@ -42,31 +42,31 @@ SELECT '1 2'::txtidx;
  '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'
@@ -97,13 +97,13 @@ SELECT ' 1 '::query_txt;
  '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'
@@ -301,7 +301,7 @@ SELECT '1&(2&(4&(5|!6)))'::query_txt;
  '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 \' !|&' )
@@ -331,13 +331,13 @@ SELECT ' 1 '::mquery_txt;
  '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'
@@ -535,7 +535,7 @@ SELECT '1&(2&(4&(5|!6)))'::mquery_txt;
  '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' )
@@ -694,7 +694,7 @@ SELECT count(*) FROM test_txtidx WHERE a ## '(eq|yt)&(wR|qh)';
     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                                                                                                                                                                                                                                                                                                                                                   
@@ -708,7 +708,7 @@ SELECT txtidxsize(txt2txtidx('345 qw'));
           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 
index 70ab3a3b007d67e0cca0db9e59e8b0f84b7c2dc4..3bb3cc980c2efb2542f350301121bebfcb8d03e8 100644 (file)
@@ -12,19 +12,19 @@ SELECT '1 '::txtidx;
 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;
@@ -57,13 +57,13 @@ 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&(''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;
@@ -96,7 +96,7 @@ 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 '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 );
@@ -133,13 +133,13 @@ SELECT count(*) FROM test_txtidx WHERE a ## 'eq|yt';
 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'));
 
index 5613ffc40b0a564eb7200b8f17523872410fd8a0..3753e5f820627ba334881ca77fc89df64c05b6f7 100644 (file)
@@ -3,7 +3,7 @@
  *                             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.
  *
@@ -2563,7 +2563,7 @@ get_const_expr(Const *constval, deparse_context *context)
 
                                if (ch == '\'' || ch == '\\')
                                {
-                                       appendStringInfoChar(buf, '\\');
+                                       appendStringInfoChar(buf, ch);
                                        appendStringInfoChar(buf, ch);
                                }
                                else if (((unsigned char) ch) < ((unsigned char) ' '))
index 8290e124def58c98481824b73b29758b26caaa65..8bc70dffda57923a5135512d94fb598a897c324e 100644 (file)
@@ -22,7 +22,7 @@
  *
  *
  * 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 $
  *
  *-------------------------------------------------------------------------
  */
@@ -6410,7 +6410,7 @@ dumpTriggers(Archive *fout, TableInfo *tblinfo, int numTables)
                                for (s = tgargs; s < p;)
                                {
                                        if (*s == '\'')
-                                               appendPQExpBufferChar(query, '\\');
+                                               appendPQExpBufferChar(query, *s);
                                        appendPQExpBufferChar(query, *s++);
                                }
                                appendPQExpBufferChar(query, '\'');
index fbe8a32a183c5846b69891ceb372b56052994b02..63aaf8fa3777bced662047a772b40dd76cd69101 100644 (file)
@@ -3,7 +3,7 @@
  *
  * 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"
@@ -217,7 +217,7 @@ do_lo_import(const char *filename_arg, const char *comment_arg)
                for (i = 0; i < slen; i++)
                {
                        if (comment_arg[i] == '\'' || comment_arg[i] == '\\')
-                               *bufptr++ = '\\';
+                               *bufptr++ = comment_arg[i];
                        *bufptr++ = comment_arg[i];
                }
                strcpy(bufptr, "')");
index 751de6cd223d3b0c89c32271b353973303430488..b67e582b969bd0574483855cbad643457953feac 100644 (file)
@@ -12,7 +12,7 @@
 #
 #
 # 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 $
 #
 #-------------------------------------------------------------------------
 
@@ -181,7 +181,7 @@ fi
 
 
 # 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'`
 
@@ -201,7 +201,7 @@ fi
 # 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
index 78771d944d51b8a86fda7179814ec91a0f5f143d..61409419809d517669bd7b2d7d13a2af095dbb36 100644 (file)
@@ -83,7 +83,7 @@ exec sql end declare section;
         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");
index b7ce079471966c6c2ff429bd6f566171e063f5bc..66e4471235e55245448c66d0cd57ca9ab8f3759e 100644 (file)
@@ -8,7 +8,7 @@ import java.util.Vector;
 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
@@ -936,7 +936,7 @@ public abstract class AbstractJdbc1Statement implements org.postgresql.PGStateme
                        {
                            case '\\':
                            case '\'':
-                                       p_output.append('\\');
+                                       p_output.append(c);
                                        p_output.append(c);
                                        break;
                            case '\0':
index ae507d30e96defd53026c948827b78c4a8b980ed..b5dc8de0a874782dada3b728fc181c43b0741075 100644 (file)
@@ -8,7 +8,7 @@
  *
  *
  * 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 $
  *
  *-------------------------------------------------------------------------
  */
@@ -161,7 +161,7 @@ PQescapeBytea(unsigned char *bintext, size_t binlen, size_t *bytealen)
                }
                else if (*vp == '\'')
                {
-                       rp[0] = '\\';
+                       rp[0] = '\'';
                        rp[1] = '\'';
                        rp += 2;
                }
index af2b412bdfc8280dd68b9faf013ce80abef48379..8369071e077c2decd17d74517a10dc047f792480 100755 (executable)
@@ -120,16 +120,16 @@ def comp_func(pgcnx):
        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
index 03babed2a173de0ed8b009a94542b7928142db36..962fc59c4b8e4e4932216b034e15b7f7cd621027 100644 (file)
@@ -4,7 +4,7 @@
  *                                               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.
  *
@@ -387,7 +387,7 @@ decl_statement      : decl_varname decl_const decl_datatype decl_notnull decl_defval
                                                while (*cp1 != '\0')
                                                {
                                                        if (*cp1 == '\\' || *cp1 == '\'')
-                                                               *cp2++ = '\\';
+                                                               *cp2++ = *cp1;
                                                        *cp2++ = *cp1++;
                                                }
                                                strcpy(cp2, "'::refcursor");
index 8438e6daece36141ff284b569e5d5514cc940d03..b2d7060a783bcb837b9c560053351d21ba6f3d9d 100644 (file)
@@ -6,7 +6,7 @@
 --
 -- 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 $
 --
 ---------------------------------------------------------------------------
 
@@ -76,10 +76,10 @@ WHERE EMP.cubicle ~= '(2,1)'::point;
 -- 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