Skip to content

Commit ad98575

Browse files
committed
Use SQL standard '' rather than \' for tutorial/sample code.
Backpatch to 8.1.X.
1 parent 637028a commit ad98575

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/interfaces/ecpg/test/test1.pgc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ exec sql end declare section;
8787
exec sql execute immediate :command;
8888
printf("New tuple got OID = %ld\n", sqlca.sqlerrd[1]);
8989

90-
sprintf(command, "insert into \"Test\" (name, amount, letter) values ('db: \\\'mm\\\'', 2, 't')");
90+
sprintf(command, "insert into \"Test\" (name, amount, letter) values ('db: ''mm''', 2, 't')");
9191
exec sql execute immediate :command;
9292

9393
strcpy(msg, "execute insert 2");

src/tutorial/funcs.source

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
--
77
-- Copyright (c) 1994-5, Regents of the University of California
88
--
9-
-- $PostgreSQL: pgsql/src/tutorial/funcs.source,v 1.8 2006/02/27 16:09:50 petere Exp $
9+
-- $PostgreSQL: pgsql/src/tutorial/funcs.source,v 1.9 2006/05/11 19:21:14 momjian Exp $
1010
--
1111
---------------------------------------------------------------------------
1212

@@ -76,10 +76,10 @@ WHERE EMP.cubicle ~= '(2,1)'::point;
7676
-- columns of EMP.
7777

7878
CREATE FUNCTION new_emp() RETURNS EMP
79-
AS 'SELECT \'None\'::text AS name,
79+
AS 'SELECT ''None''::text AS name,
8080
1000 AS salary,
8181
25 AS age,
82-
\'(2,2)\'::point AS cubicle'
82+
''(2,2)''::point AS cubicle'
8383
LANGUAGE SQL;
8484

8585
-- you can then project a column out of resulting the tuple by using the

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy