diff options
author | Bruce Momjian <bruce@momjian.us> | 2005-06-26 03:04:37 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2005-06-26 03:04:37 +0000 |
commit | bb3cce4ec9cc157a8dfc80b5b1770c2beac0a57e (patch) | |
tree | 5631b9dda006f8c56f6b1d4f64c72f015adf2468 /src/include | |
parent | c96375a39b28e54e19fa5c9c2e3dd69c44b7618c (diff) | |
download | postgresql-bb3cce4ec9cc157a8dfc80b5b1770c2beac0a57e.tar.gz postgresql-bb3cce4ec9cc157a8dfc80b5b1770c2beac0a57e.zip |
Add E'' syntax so eventually normal strings can treat backslashes
literally.
Add GUC variables:
"escape_string_warning" - warn about backslashes in non-E strings
"escape_string_syntax" - supports E'' syntax?
"standard_compliant_strings" - treats backslashes literally in ''
Update code to use E'' when escapes are used.
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/catalog/pg_proc.h | 10 | ||||
-rw-r--r-- | src/include/utils/guc.h | 3 |
2 files changed, 7 insertions, 6 deletions
diff --git a/src/include/catalog/pg_proc.h b/src/include/catalog/pg_proc.h index 892835075aa..049024ae40c 100644 --- a/src/include/catalog/pg_proc.h +++ b/src/include/catalog/pg_proc.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/catalog/pg_proc.h,v 1.370 2005/06/24 20:53:32 tgl Exp $ + * $PostgreSQL: pgsql/src/include/catalog/pg_proc.h,v 1.371 2005/06/26 03:04:01 momjian Exp $ * * NOTES * The script catalog/genbki.sh reads this file and generates .bki @@ -1462,7 +1462,7 @@ DATA(insert OID = 1156 ( timestamptz_ge PGNSP PGUID 12 f f t f i 2 16 "1184 1 DESCR("greater-than-or-equal"); DATA(insert OID = 1157 ( timestamptz_gt PGNSP PGUID 12 f f t f i 2 16 "1184 1184" _null_ _null_ _null_ timestamp_gt - _null_ )); DESCR("greater-than"); -DATA(insert OID = 1158 ( to_timestamp PGNSP PGUID 14 f f t f i 1 1184 "701" _null_ _null_ _null_ "select (\'epoch\'::timestamptz + $1 * \'1 second\'::interval)" - _null_ )); +DATA(insert OID = 1158 ( to_timestamp PGNSP PGUID 14 f f t f i 1 1184 "701" _null_ _null_ _null_ "select (''epoch''::timestamptz + $1 * ''1 second''::interval)" - _null_ )); DESCR("convert UNIX epoch to timestamptz"); DATA(insert OID = 1159 ( timezone PGNSP PGUID 12 f f t f i 2 1114 "25 1184" _null_ _null_ _null_ timestamptz_zone - _null_ )); DESCR("adjust timestamp to new time zone"); @@ -1542,7 +1542,7 @@ DESCR("adjust interval precision"); DATA(insert OID = 1215 ( obj_description PGNSP PGUID 14 f f t f s 2 25 "26 19" _null_ _null_ _null_ "select description from pg_catalog.pg_description where objoid = $1 and classoid = (select oid from pg_catalog.pg_class where relname = $2 and relnamespace = PGNSP) and objsubid = 0" - _null_ )); DESCR("get description for object id and catalog name"); -DATA(insert OID = 1216 ( col_description PGNSP PGUID 14 f f t f s 2 25 "26 23" _null_ _null_ _null_ "select description from pg_catalog.pg_description where objoid = $1 and classoid = \'pg_catalog.pg_class\'::regclass and objsubid = $2" - _null_ )); +DATA(insert OID = 1216 ( col_description PGNSP PGUID 14 f f t f s 2 25 "26 23" _null_ _null_ _null_ "select description from pg_catalog.pg_description where objoid = $1 and classoid = ''pg_catalog.pg_class''::regclass and objsubid = $2" - _null_ )); DESCR("get description for table column"); DATA(insert OID = 1217 ( date_trunc PGNSP PGUID 12 f f t f s 2 1184 "25 1184" _null_ _null_ _null_ timestamptz_trunc - _null_ )); @@ -2186,9 +2186,9 @@ DATA(insert OID = 877 ( substr PGNSP PGUID 12 f f t f i 3 25 "25 23 23" _nu DESCR("return portion of string"); DATA(insert OID = 878 ( translate PGNSP PGUID 12 f f t f i 3 25 "25 25 25" _null_ _null_ _null_ translate - _null_ )); DESCR("map a set of character appearing in string"); -DATA(insert OID = 879 ( lpad PGNSP PGUID 14 f f t f i 2 25 "25 23" _null_ _null_ _null_ "select pg_catalog.lpad($1, $2, \' \')" - _null_ )); +DATA(insert OID = 879 ( lpad PGNSP PGUID 14 f f t f i 2 25 "25 23" _null_ _null_ _null_ "select pg_catalog.lpad($1, $2, '' '')" - _null_ )); DESCR("left-pad string to length"); -DATA(insert OID = 880 ( rpad PGNSP PGUID 14 f f t f i 2 25 "25 23" _null_ _null_ _null_ "select pg_catalog.rpad($1, $2, \' \')" - _null_ )); +DATA(insert OID = 880 ( rpad PGNSP PGUID 14 f f t f i 2 25 "25 23" _null_ _null_ _null_ "select pg_catalog.rpad($1, $2, '' '')" - _null_ )); DESCR("right-pad string to length"); DATA(insert OID = 881 ( ltrim PGNSP PGUID 12 f f t f i 1 25 "25" _null_ _null_ _null_ ltrim1 - _null_ )); DESCR("trim spaces from left end of string"); diff --git a/src/include/utils/guc.h b/src/include/utils/guc.h index ed2748e8b23..c08ecd4db42 100644 --- a/src/include/utils/guc.h +++ b/src/include/utils/guc.h @@ -7,7 +7,7 @@ * Copyright (c) 2000-2005, PostgreSQL Global Development Group * Written by Peter Eisentraut <peter_e@gmx.net>. * - * $PostgreSQL: pgsql/src/include/utils/guc.h,v 1.60 2005/03/25 16:17:28 tgl Exp $ + * $PostgreSQL: pgsql/src/include/utils/guc.h,v 1.61 2005/06/26 03:04:12 momjian Exp $ *-------------------------------------------------------------------- */ #ifndef GUC_H @@ -120,6 +120,7 @@ extern bool SQL_inheritance; extern bool Australian_timezones; extern bool default_with_oids; +extern bool escape_string_warning; extern int log_min_error_statement; extern int log_min_messages; |