Go to the source code of this file.
◆ replace_percent_placeholders()
Definition at line 59 of file percentrepl.c.
60{
62
64
65 for (
const char *
sp = instr; *
sp;
sp++)
66 {
68 {
70 {
71
74 }
75 else if (
sp[1] ==
'\0')
76 {
77
78#ifdef FRONTEND
82#else
86 errdetail(
"String ends unexpectedly after escape character \"%%\"."));
87#endif
88 }
89 else
90 {
91
92 bool found = false;
94
96
99 {
101
103 {
105 {
107 found = true;
108 }
109
110 break;
111 }
112 }
114 if (!found)
115 {
116
117#ifdef FRONTEND
121#else
125 errdetail(
"String contains unexpected placeholder \"%%%c\".", *
sp));
126#endif
127 }
128 }
129 }
130 else
131 {
133 }
134 }
135
137}
int errdetail(const char *fmt,...)
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#define ereport(elevel,...)
#define pg_log_error(...)
#define pg_log_error_detail(...)
void appendStringInfoString(StringInfo str, const char *s)
void appendStringInfoChar(StringInfo str, char ch)
void initStringInfo(StringInfo str)
References appendStringInfoChar(), appendStringInfoString(), StringInfoData::data, ereport, errcode(), errdetail(), errmsg(), ERROR, fb(), initStringInfo(), pg_log_error, pg_log_error_detail, and val.
Referenced by BuildRestoreCommand(), ExecuteRecoveryCommand(), run_ssl_passphrase_command(), shell_archive_file(), and shell_construct_command().