summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/backend/utils/adt/ruleutils.c4
-rw-r--r--src/bin/pg_dump/pg_dump.c4
-rw-r--r--src/bin/psql/large_obj.c4
-rw-r--r--src/bin/scripts/createdb6
-rw-r--r--src/interfaces/ecpg/test/test1.pgc2
-rw-r--r--src/interfaces/jdbc/org/postgresql/jdbc1/AbstractJdbc1Statement.java4
-rw-r--r--src/interfaces/libpq/fe-exec.c4
-rwxr-xr-xsrc/interfaces/python/tutorial/func.py8
-rw-r--r--src/pl/plpgsql/src/gram.y4
-rw-r--r--src/tutorial/funcs.source6
10 files changed, 23 insertions, 23 deletions
diff --git a/src/backend/utils/adt/ruleutils.c b/src/backend/utils/adt/ruleutils.c
index 5613ffc40b0..3753e5f8206 100644
--- a/src/backend/utils/adt/ruleutils.c
+++ b/src/backend/utils/adt/ruleutils.c
@@ -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) ' '))
diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c
index 8290e124def..8bc70dffda5 100644
--- a/src/bin/pg_dump/pg_dump.c
+++ b/src/bin/pg_dump/pg_dump.c
@@ -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, '\'');
diff --git a/src/bin/psql/large_obj.c b/src/bin/psql/large_obj.c
index fbe8a32a183..63aaf8fa377 100644
--- a/src/bin/psql/large_obj.c
+++ b/src/bin/psql/large_obj.c
@@ -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, "')");
diff --git a/src/bin/scripts/createdb b/src/bin/scripts/createdb
index 751de6cd223..b67e582b969 100644
--- a/src/bin/scripts/createdb
+++ b/src/bin/scripts/createdb
@@ -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
diff --git a/src/interfaces/ecpg/test/test1.pgc b/src/interfaces/ecpg/test/test1.pgc
index 78771d944d5..61409419809 100644
--- a/src/interfaces/ecpg/test/test1.pgc
+++ b/src/interfaces/ecpg/test/test1.pgc
@@ -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");
diff --git a/src/interfaces/jdbc/org/postgresql/jdbc1/AbstractJdbc1Statement.java b/src/interfaces/jdbc/org/postgresql/jdbc1/AbstractJdbc1Statement.java
index b7ce0794719..66e4471235e 100644
--- a/src/interfaces/jdbc/org/postgresql/jdbc1/AbstractJdbc1Statement.java
+++ b/src/interfaces/jdbc/org/postgresql/jdbc1/AbstractJdbc1Statement.java
@@ -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':
diff --git a/src/interfaces/libpq/fe-exec.c b/src/interfaces/libpq/fe-exec.c
index ae507d30e96..b5dc8de0a87 100644
--- a/src/interfaces/libpq/fe-exec.c
+++ b/src/interfaces/libpq/fe-exec.c
@@ -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;
}
diff --git a/src/interfaces/python/tutorial/func.py b/src/interfaces/python/tutorial/func.py
index af2b412bdfc..8369071e077 100755
--- a/src/interfaces/python/tutorial/func.py
+++ b/src/interfaces/python/tutorial/func.py
@@ -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
diff --git a/src/pl/plpgsql/src/gram.y b/src/pl/plpgsql/src/gram.y
index 03babed2a17..962fc59c4b8 100644
--- a/src/pl/plpgsql/src/gram.y
+++ b/src/pl/plpgsql/src/gram.y
@@ -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");
diff --git a/src/tutorial/funcs.source b/src/tutorial/funcs.source
index 8438e6daece..b2d7060a783 100644
--- a/src/tutorial/funcs.source
+++ b/src/tutorial/funcs.source
@@ -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