Use SQL standard '' rather than \' for tutorial/sample code.
authorBruce Momjian
Thu, 11 May 2006 19:21:14 +0000 (19:21 +0000)
committerBruce Momjian
Thu, 11 May 2006 19:21:14 +0000 (19:21 +0000)
Backpatch to 8.1.X.

src/interfaces/ecpg/test/test1.pgc
src/tutorial/funcs.source

index 91124bbdc29b0459ae0ba22f95dc867769e4ce3d..2aa40ab15e8d95adb66e96bd3648900141ff2b55 100644 (file)
@@ -87,7 +87,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 919ec7de28dc8cdd522c8c342a2b788cf2d73ee2..32dd50c2abe8634ca18249bc68d5ff01c9b6aa6d 100644 (file)
@@ -6,7 +6,7 @@
 --
 -- Copyright (c) 1994-5, Regents of the University of California
 --
--- $PostgreSQL: pgsql/src/tutorial/funcs.source,v 1.8 2006/02/27 16:09:50 petere Exp $
+-- $PostgreSQL: pgsql/src/tutorial/funcs.source,v 1.9 2006/05/11 19:21:14 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