postgresql/src/tools
Andres Freund 26aaf97b68 Make StringInfo available to frontend code.
There's plenty places in frontend code that could benefit from a
string buffer implementation. Some because it yields simpler and
faster code, and some others because of the desire to share code
between backend and frontend.

While there is a string buffer implementation available to frontend
code, libpq's PQExpBuffer, it is clunkier than stringinfo, it
introduces a libpq dependency, doesn't allow for sharing between
frontend and backend code, and has a higher API/ABI stability
requirement due to being exposed via libpq.

Therefore it seems best to just making StringInfo being usable by
frontend code. There's not much to do for that, except for rewriting
two subsequent elog/ereport calls into others types of error
reporting, and deciding on a maximum string length.

For the maximum string size I decided to privately define MaxAllocSize
to the same value as used in the backend. It seems likely that we'll
want to reconsider this for both backend and frontend code in the not
too far away future.

For now I've left stringinfo.h in lib/, rather than common/, to reduce
the likelihood of unnecessary breakage. We could alternatively decide
to provide a redirecting stringinfo.h in lib/, or just not provide
compatibility.

Author: Andres Freund
Reviewed-By: Kyotaro Horiguchi, Daniel Gustafsson
Discussion: https://postgr.es/m/20190920051857.2fhnvhvx4qdddviz@alap3.anarazel.de
2019-11-05 14:56:40 -08:00
..
editors Make Emacs perl-mode indent more like perltidy. 2019-01-13 11:32:31 -08:00
findoidjoins Split all OBJS style lines in makefiles into one-line-per-entry style. 2019-11-05 14:41:07 -08:00
ifaddrs Split all OBJS style lines in makefiles into one-line-per-entry style. 2019-11-05 14:41:07 -08:00
make_diff Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
msvc Make StringInfo available to frontend code. 2019-11-05 14:56:40 -08:00
perlcheck Fix whitespace 2018-06-27 08:03:54 +02:00
pginclude For all ppc compilers, implement compare_exchange and fetch_add with asm. 2019-10-18 20:20:52 -07:00
pgindent Add dummy_index_am to src/test/modules/ 2019-09-25 12:11:12 +09:00
PerfectHash.pm Make our perfect hash functions be valid C++. 2019-05-31 10:40:00 -04:00
RELEASE_CHANGES Fix incorrect use of term HEAD for Git 2019-10-07 09:44:17 +02:00
ccsym tools/ccsym: update for modern versions of gcc 2015-01-20 13:02:58 -05:00
check_bison_recursion.pl Update copyright for 2019 2019-01-02 12:44:25 -05:00
codelines Fix remaining stray references to CVS. 2010-09-22 19:51:39 -04:00
copyright.pl Update copyright for 2019 2019-01-02 12:44:25 -05:00
find_badmacros Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
find_static Fix omission of -X (--no-psqlrc) in some psql invocations. 2015-12-28 11:46:43 -05:00
find_typedef Refer to OS X as "macOS", except for the port name which is still "darwin". 2016-09-25 15:40:57 -04:00
fix-old-flex-code.pl Replace @postgresql.org with @lists.postgresql.org for mailinglists 2019-01-19 19:06:35 +01:00
gen_keywordlist.pl Initial pgperltidy run for v12. 2019-05-22 13:36:19 -04:00
git-external-diff Preserve information on use of git-external-diff 2018-05-24 23:45:31 +09:30
git_changelog Fix incorrect use of term HEAD for Git 2019-10-07 09:44:17 +02:00
make_ctags Improve missing-program error handling in make_ctags and make_etags. 2019-01-13 13:33:50 -05:00
make_etags Improve missing-program error handling in make_ctags and make_etags. 2019-01-13 13:33:50 -05:00
make_mkid Add another pgdefine path check, and a cvs-git change. 2011-08-26 21:52:35 -04:00
pgtest pgtest: run clean, build, and check stages separately 2018-07-28 15:34:06 -04:00
testint128.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
valgrind.supp Revert "Add valgrind suppressions for wcsrtombs optimizations" 2019-01-19 20:49:51 +01:00
version_stamp.pl Stamp HEAD as 13devel. 2019-07-01 12:50:55 -04:00
win32tzlist.pl Update copyright for 2019 2019-01-02 12:44:25 -05:00