mirror of
https://github.com/postgres/postgres.git
synced 2025-07-08 11:42:09 +03:00
chomp PQerrorMessage() in backend uses
PQerrorMessage() returns an error message with a trailing newline, but in backend use (dblink, postgres_fdw, libpqwalreceiver), we want to have the error message without that for emitting via ereport(). To simplify that, add a function pchomp() that returns a pstrdup'ed string with the trailing newline characters removed.
This commit is contained in:
@ -127,6 +127,8 @@ extern char *MemoryContextStrdup(MemoryContext context, const char *string);
|
||||
extern char *pstrdup(const char *in);
|
||||
extern char *pnstrdup(const char *in, Size len);
|
||||
|
||||
extern char *pchomp(const char *in);
|
||||
|
||||
/* sprintf into a palloc'd buffer --- these are in psprintf.c */
|
||||
extern char *psprintf(const char *fmt,...) pg_attribute_printf(1, 2);
|
||||
extern size_t pvsnprintf(char *buf, size_t len, const char *fmt, va_list args) pg_attribute_printf(3, 0);
|
||||
|
Reference in New Issue
Block a user