aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/backend/utils/adt/ruleutils.c6
-rw-r--r--src/bin/initdb/initdb.c4
-rw-r--r--src/bin/pg_dump/pg_dump.c4
-rw-r--r--src/bin/psql/large_obj.c4
-rw-r--r--src/interfaces/ecpg/test/test1.pgc2
-rw-r--r--src/interfaces/libpq/fe-exec.c4
-rw-r--r--src/pl/plpgsql/src/gram.y4
-rw-r--r--src/tutorial/funcs.source6
8 files changed, 17 insertions, 17 deletions
diff --git a/src/backend/utils/adt/ruleutils.c b/src/backend/utils/adt/ruleutils.c
index d35529c72e8..3113dfa09ea 100644
--- a/src/backend/utils/adt/ruleutils.c
+++ b/src/backend/utils/adt/ruleutils.c
@@ -3,7 +3,7 @@
* back to source text
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/adt/ruleutils.c,v 1.188.4.4 2006/01/26 17:08:34 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/adt/ruleutils.c,v 1.188.4.5 2006/05/21 19:57:39 momjian Exp $
*
* This software is copyrighted by Jan Wieck - Hamburg.
*
@@ -568,7 +568,7 @@ pg_get_triggerdef(PG_FUNCTION_ARGS)
{
/* escape quotes and backslashes */
if (*p == '\'' || *p == '\\')
- appendStringInfoChar(&buf, '\\');
+ appendStringInfoChar(&buf, *p);
appendStringInfoChar(&buf, *p++);
}
p++;
@@ -3699,7 +3699,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/initdb/initdb.c b/src/bin/initdb/initdb.c
index a4c8b70ccbe..d44e3cdbe53 100644
--- a/src/bin/initdb/initdb.c
+++ b/src/bin/initdb/initdb.c
@@ -39,7 +39,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
* Portions taken from FreeBSD.
*
- * $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.73.4.3 2006/02/24 00:54:27 adunstan Exp $
+ * $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.73.4.4 2006/05/21 19:57:39 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -1955,7 +1955,7 @@ escape_quotes(const char *src)
for (i = 0, j = 0; i < len; i++)
{
if (src[i] == '\'' || src[i] == '\\')
- result[j++] = '\\';
+ result[j++] = src[i];
result[j++] = src[i];
}
result[j] = '\0';
diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c
index f71d41a2394..a99b83372f0 100644
--- a/src/bin/pg_dump/pg_dump.c
+++ b/src/bin/pg_dump/pg_dump.c
@@ -12,7 +12,7 @@
* by PostgreSQL
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.c,v 1.400.4.6 2006/01/09 21:16:37 tgl Exp $
+ * $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.c,v 1.400.4.7 2006/05/21 19:57:39 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -7553,7 +7553,7 @@ dumpTrigger(Archive *fout, TriggerInfo *tginfo)
while (s < p)
{
if (*s == '\'')
- appendPQExpBufferChar(query, '\\');
+ appendPQExpBufferChar(query, '\'');
appendPQExpBufferChar(query, *s++);
}
appendPQExpBufferChar(query, '\'');
diff --git a/src/bin/psql/large_obj.c b/src/bin/psql/large_obj.c
index 2b2a730f5b0..dff8cad571e 100644
--- a/src/bin/psql/large_obj.c
+++ b/src/bin/psql/large_obj.c
@@ -3,7 +3,7 @@
*
* Copyright (c) 2000-2005, PostgreSQL Global Development Group
*
- * $PostgreSQL: pgsql/src/bin/psql/large_obj.c,v 1.35 2005/01/01 05:43:08 momjian Exp $
+ * $PostgreSQL: pgsql/src/bin/psql/large_obj.c,v 1.35.4.1 2006/05/21 19:57:39 momjian Exp $
*/
#include "postgres_fe.h"
#include "large_obj.h"
@@ -178,7 +178,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/interfaces/ecpg/test/test1.pgc b/src/interfaces/ecpg/test/test1.pgc
index 753c0abae5d..f44c6fe0b8a 100644
--- a/src/interfaces/ecpg/test/test1.pgc
+++ b/src/interfaces/ecpg/test/test1.pgc
@@ -84,7 +84,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/libpq/fe-exec.c b/src/interfaces/libpq/fe-exec.c
index 3b8d9629328..f24d5f4439d 100644
--- a/src/interfaces/libpq/fe-exec.c
+++ b/src/interfaces/libpq/fe-exec.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/interfaces/libpq/fe-exec.c,v 1.166 2004/12/31 22:03:50 pgsql Exp $
+ * $PostgreSQL: pgsql/src/interfaces/libpq/fe-exec.c,v 1.166.4.1 2006/05/21 19:57:39 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -2433,7 +2433,7 @@ PQescapeBytea(const unsigned char *bintext, size_t binlen, size_t *bytealen)
}
else if (*vp == '\'')
{
- rp[0] = '\\';
+ rp[0] = '\'';
rp[1] = '\'';
rp += 2;
}
diff --git a/src/pl/plpgsql/src/gram.y b/src/pl/plpgsql/src/gram.y
index a4fa1546b90..4e4ff9af70e 100644
--- a/src/pl/plpgsql/src/gram.y
+++ b/src/pl/plpgsql/src/gram.y
@@ -4,7 +4,7 @@
* procedural language
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/pl/plpgsql/src/gram.y,v 1.64.4.3 2005/02/08 18:21:59 tgl Exp $
+ * $PostgreSQL: pgsql/src/pl/plpgsql/src/gram.y,v 1.64.4.4 2006/05/21 19:57:39 momjian Exp $
*
* This software is copyrighted by Jan Wieck - Hamburg.
*
@@ -389,7 +389,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 4dfdf278333..1c981e1f3ac 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
--
--- $PostgreSQL: pgsql/src/tutorial/funcs.source,v 1.7 2003/11/29 22:41:33 pgsql Exp $
+-- $PostgreSQL: pgsql/src/tutorial/funcs.source,v 1.7.4.1 2006/05/21 19:57:40 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