Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
2288d646
Commit
2288d646
authored
Apr 04, 2008
by
Magnus Hagander
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Convert backslash_quote guc to use enum.
parent
d672ea6f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
14 deletions
+29
-14
src/backend/utils/misc/guc.c
src/backend/utils/misc/guc.c
+27
-12
src/include/parser/gramparse.h
src/include/parser/gramparse.h
+2
-2
No files found.
src/backend/utils/misc/guc.c
View file @
2288d646
...
...
@@ -10,7 +10,7 @@
* Written by Peter Eisentraut <peter_e@gmx.net>.
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.44
4 2008/04/04 08:33:15
mha Exp $
* $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.44
5 2008/04/04 11:47:19
mha Exp $
*
*--------------------------------------------------------------------
*/
...
...
@@ -153,7 +153,6 @@ static bool assign_stage_log_stats(bool newval, bool doit, GucSource source);
static
bool
assign_log_stats
(
bool
newval
,
bool
doit
,
GucSource
source
);
static
bool
assign_transaction_read_only
(
bool
newval
,
bool
doit
,
GucSource
source
);
static
const
char
*
assign_canonical_path
(
const
char
*
newval
,
bool
doit
,
GucSource
source
);
static
const
char
*
assign_backslash_quote
(
const
char
*
newval
,
bool
doit
,
GucSource
source
);
static
const
char
*
assign_timezone_abbreviations
(
const
char
*
newval
,
bool
doit
,
GucSource
source
);
static
const
char
*
show_archive_command
(
void
);
static
bool
assign_tcp_keepalives_idle
(
int
newval
,
bool
doit
,
GucSource
source
);
...
...
@@ -253,6 +252,23 @@ static const struct config_enum_entry xmloption_options[] = {
{
NULL
,
0
}
};
/*
* Although only "on", "off", and "safe_encoding" are documented, we
* accept all the likely variants of "on" and "off".
*/
static
const
struct
config_enum_entry
backslash_quote_options
[]
=
{
{
"safe_encoding"
,
BACKSLASH_QUOTE_SAFE_ENCODING
},
{
"on"
,
BACKSLASH_QUOTE_ON
},
{
"off"
,
BACKSLASH_QUOTE_OFF
},
{
"true"
,
BACKSLASH_QUOTE_ON
},
{
"false"
,
BACKSLASH_QUOTE_OFF
},
{
"yes"
,
BACKSLASH_QUOTE_ON
},
{
"no"
,
BACKSLASH_QUOTE_OFF
},
{
"1"
,
BACKSLASH_QUOTE_ON
},
{
"0"
,
BACKSLASH_QUOTE_OFF
},
{
NULL
,
0
}
};
/*
* GUC option variables that are exported from this module
*/
...
...
@@ -311,7 +327,6 @@ static char *syslog_ident_str;
static
bool
phony_autocommit
;
static
bool
session_auth_is_superuser
;
static
double
phony_random_seed
;
static
char
*
backslash_quote_string
;
static
char
*
client_encoding_string
;
static
char
*
datestyle_string
;
static
char
*
locale_collate
;
...
...
@@ -1959,15 +1974,6 @@ static struct config_string ConfigureNamesString[] =
""
,
NULL
,
show_archive_command
},
{
{
"backslash_quote"
,
PGC_USERSET
,
COMPAT_OPTIONS_PREVIOUS
,
gettext_noop
(
"Sets whether
\"\\
'
\"
is allowed in string literals."
),
gettext_noop
(
"Valid values are ON, OFF, and SAFE_ENCODING."
)
},
&
backslash_quote_string
,
"safe_encoding"
,
assign_backslash_quote
,
NULL
},
{
{
"client_encoding"
,
PGC_USERSET
,
CLIENT_CONN_LOCALE
,
gettext_noop
(
"Sets the client's character set encoding."
),
...
...
@@ -2419,6 +2425,15 @@ static struct config_string ConfigureNamesString[] =
static
struct
config_enum
ConfigureNamesEnum
[]
=
{
{
{
"backslash_quote"
,
PGC_USERSET
,
COMPAT_OPTIONS_PREVIOUS
,
gettext_noop
(
"Sets whether
\"\\
'
\"
is allowed in string literals."
),
gettext_noop
(
"Valid values are ON, OFF, and SAFE_ENCODING."
)
},
&
backslash_quote
,
BACKSLASH_QUOTE_SAFE_ENCODING
,
backslash_quote_options
,
NULL
,
NULL
},
{
{
"client_min_messages"
,
PGC_USERSET
,
LOGGING_WHEN
,
gettext_noop
(
"Sets the message levels that are sent to the client."
),
...
...
src/include/parser/gramparse.h
View file @
2288d646
...
...
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $PostgreSQL: pgsql/src/include/parser/gramparse.h,v 1.4
0 2008/01/01 19:45:58 momjian
Exp $
* $PostgreSQL: pgsql/src/include/parser/gramparse.h,v 1.4
1 2008/04/04 11:47:19 mha
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -35,7 +35,7 @@ typedef enum
}
BackslashQuoteType
;
/* GUC variables in scan.l (every one of these is a bad idea :-() */
extern
BackslashQuoteType
backslash_quote
;
extern
int
backslash_quote
;
extern
bool
escape_string_warning
;
extern
bool
standard_conforming_strings
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment