124 if (!((*
cp >=
'a' && *
cp <=
'z')
125 || (*
cp >=
'0' && *
cp <=
'9')
222 for (
int i = 0;
i < charlen;
i++)
269 if (schema && *schema)
314 char *
buf,
size_t buflen)
362 target =
buf->data +
buf->len;
424 for (
i = 0;
i < charlen;
i++)
436 buf->len = target -
buf->data;
457 if (
buf->len > 0 &&
buf->data[
buf->len - 1] !=
' ')
486 static const char suffixes[] =
"_XXXXXXX";
533 static const char hextbl[] =
"0123456789abcdef";
544 target =
buf->data +
buf->len;
555 *target++ =
hextbl[(
c >> 4) & 0xF];
563 buf->len = target -
buf->data;
587 _(
"shell command argument contains a newline or carriage return: \"%s\"\n"),
607 strspn(
str,
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_./:") ==
strlen(
str))
615 for (p =
str; *p; p++)
617 if (*p ==
'\n' || *p ==
'\r')
643 for (p =
str; *p; p++)
645 if (*p ==
'\n' || *p ==
'\r')
670 if (!((*p >=
'a' && *p <=
'z') ||
671 (*p >=
'A' && *p <=
'Z') ||
672 (*p >=
'0' && *p <=
'9')))
708 for (s =
str; *s; s++)
710 if (!((*s >=
'a' && *s <=
'z') || (*s >=
'A' && *s <=
'Z') ||
711 (*s >=
'0' && *s <=
'9') || *s ==
'_' || *s ==
'.'))
725 if (*
str ==
'\'' || *
str ==
'\\')
757 if (*s ==
'\n' || *s ==
'\r')
760 _(
"database name contains a newline or carriage return: \"%s\"\n"),
765 if (!((*s >=
'a' && *s <=
'z') || (*s >=
'A' && *s <=
'Z') ||
766 (*s >=
'0' && *s <=
'9') || *s ==
'_' || *s ==
'.'))
849 while (*
atext !=
'}')
864 while (*
atext !=
'"')
884 if (
atext[1] !=
'\0')
907 if (buffer->
data[buffer->
len - 1] !=
'{')
911 if (
value[0] ==
'\0')
920 for (tmp =
value; *tmp; tmp++)
924 if (
ch ==
'"' ||
ch ==
'\\' ||
925 ch ==
'{' ||
ch ==
'}' ||
ch ==
',' ||
927 ch ==
' ' ||
ch ==
'\t' ||
ch ==
'\n' ||
928 ch ==
'\r' ||
ch ==
'\v' ||
ch ==
'\f')
939 for (tmp =
value; *tmp; tmp++)
943 if (
ch ==
'"' ||
ch ==
'\\')
967 const char *prefix,
int encoding,
bool std_strings)
1065 (appendPQExpBufferStr(buf, have_where ? " AND " : "WHERE "), \
1066 have_where = true, added_clause = true)
1071 if (pattern ==
NULL)
1121 "(%s OPERATOR(pg_catalog.~) ",
namevar);
1126 "\n OR %s OPERATOR(pg_catalog.~) ",
1355 else if (
ch ==
'[' &&
cp[1] ==
']')
#define IS_HIGHBIT_SET(ch)
#define Assert(condition)
#define ESCAPE_STRING_SYNTAX
#define SQL_STR_DOUBLE(ch, escape_backslash)
const uint8 ScanKeywordCategories[SCANKEYWORDS_NUM_KEYWORDS]
#define fprintf(file, fmt, msg)
int PQserverVersion(const PGconn *conn)
int PQclientEncoding(const PGconn *conn)
size_t PQescapeStringConn(PGconn *conn, char *to, const char *from, size_t length, int *error)
int PQmblen(const char *s, int encoding)
int PQmblenBounded(const char *s, int encoding)
PGDLLIMPORT const ScanKeywordList ScanKeywords
#define UNRESERVED_KEYWORD
int ScanKeywordLookup(const char *str, const ScanKeywordList *keywords)
static const char * connstr
static rewind_source * source
static char buf[DEFAULT_XLOG_SEG_SIZE]
static const char hextbl[]
int pg_strcasecmp(const char *s1, const char *s2)
unsigned char pg_tolower(unsigned char ch)
PQExpBuffer createPQExpBuffer(void)
void initPQExpBuffer(PQExpBuffer str)
int enlargePQExpBuffer(PQExpBuffer str, size_t needed)
void resetPQExpBuffer(PQExpBuffer str)
void appendPQExpBuffer(PQExpBuffer str, const char *fmt,...)
void destroyPQExpBuffer(PQExpBuffer str)
void appendPQExpBufferChar(PQExpBuffer str, char ch)
void appendPQExpBufferStr(PQExpBuffer str, const char *data)
void termPQExpBuffer(PQExpBuffer str)
PQExpBufferData * PQExpBuffer
const char * fmtQualifiedId(const char *schema, const char *id)
bool appendShellStringNoError(PQExpBuffer buf, const char *str)
const char * fmtIdEnc(const char *rawid, int encoding)
const char * fmtId(const char *rawid)
const char * fmtQualifiedIdEnc(const char *schema, const char *id, int encoding)
void setFmtEncoding(int encoding)
void appendShellString(PQExpBuffer buf, const char *str)
void appendStringLiteralConn(PQExpBuffer buf, const char *str, PGconn *conn)
void appendPGArray(PQExpBuffer buffer, const char *value)
bool processSQLNamePattern(PGconn *conn, PQExpBuffer buf, const char *pattern, bool have_where, bool force_escape, const char *schemavar, const char *namevar, const char *altnamevar, const char *visibilityrule, PQExpBuffer dbnamebuf, int *dotcnt)
void appendPsqlMetaConnect(PQExpBuffer buf, const char *dbname)
void appendByteaLiteral(PQExpBuffer buf, const unsigned char *str, size_t length, bool std_strings)
bool parsePGArray(const char *atext, char ***itemarray, int *nitems)
void appendStringLiteral(PQExpBuffer buf, const char *str, int encoding, bool std_strings)
void patternToSQLRegex(int encoding, PQExpBuffer dbnamebuf, PQExpBuffer schemabuf, PQExpBuffer namebuf, const char *pattern, bool force_escape, bool want_literal_dbname, int *dotcnt)
bool appendReloptionsArray(PQExpBuffer buffer, const char *reloptions, const char *prefix, int encoding, bool std_strings)
static PQExpBuffer defaultGetLocalPQExpBuffer(void)
static int getFmtEncoding(void)
PQExpBuffer(* getLocalPQExpBuffer)(void)
void appendStringLiteralDQ(PQExpBuffer buf, const char *str, const char *dqprefix)
void appendConnStrVal(PQExpBuffer buf, const char *str)
int quote_all_identifiers
char * formatPGVersionNumber(int version_number, bool include_minor, char *buf, size_t buflen)
void pg_encoding_set_invalid(int encoding, char *dst)
int pg_encoding_mblen(int encoding, const char *mbstr)
int pg_encoding_verifymbchar(int encoding, const char *mbstr, int len)