* Return the currently configured encoding for fmtId() and fmtQualifiedId(). */
| 75 | * Return the currently configured encoding for fmtId() and fmtQualifiedId(). |
| 76 | */ |
| 77 | static int |
| 78 | getFmtEncoding(void) |
| 79 | { |
| 80 | if (fmtIdEncoding != -1) |
| 81 | return fmtIdEncoding; |
| 82 | |
| 83 | /* |
| 84 | * In assertion builds it seems best to fail hard if the encoding was not |
| 85 | * set, to make it easier to find places with missing calls. But in |
| 86 | * production builds that seems like a bad idea, thus we instead just |
| 87 | * default to UTF-8. |
| 88 | */ |
| 89 | Assert(fmtIdEncoding != -1); |
| 90 | |
| 91 | return PG_UTF8; |
| 92 | } |
| 93 | |
| 94 | /* |
| 95 | * Quotes input string if it's not a legitimate SQL identifier as-is. |
no outgoing calls
no test coverage detected