postgresql/src/common
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
..
unicode Update unicode.org URLs 2019-10-13 22:10:38 +02:00
.gitignore Replace the data structure used for keyword lookup. 2019-01-06 17:02:57 -05:00
Makefile Make StringInfo available to frontend code. 2019-11-05 14:56:40 -08:00
base64.c Introduce safer encoding and decoding routines for base64.c 2019-07-04 16:08:09 +09:00
config_info.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
controldata_utils.c Use consistent style for checking return from system calls 2019-07-07 15:28:49 +02:00
d2s.c Initial pgindent run for v12. 2019-05-22 12:55:34 -04:00
d2s_full_table.h Change floating-point output format for improved performance. 2019-02-13 15:20:33 +00:00
d2s_intrinsics.h Change floating-point output format for improved performance. 2019-02-13 15:20:33 +00:00
digit_table.h Change floating-point output format for improved performance. 2019-02-13 15:20:33 +00:00
exec.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
f2s.c Make the order of the header file includes consistent in non-backend modules. 2019-10-25 07:41:52 +05:30
fe_memutils.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
file_perm.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
file_utils.c Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
ip.c Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
keywords.c Replace the data structure used for keyword lookup. 2019-01-06 17:02:57 -05:00
kwlookup.c Use perfect hashing, instead of binary search, for keyword lookup. 2019-01-09 19:47:46 -05:00
link-canary.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
logging.c In pg_log_generic(), be more paranoid about preserving errno. 2019-07-06 11:25:37 -04:00
md5.c Fix inconsistencies and typos in the tree 2019-07-22 10:01:50 +09:00
pg_lzcompress.c Optimize partial TOAST decompression 2019-10-01 14:28:28 +02:00
pgfnames.c Move logging.h and logging.c from src/fe_utils/ to src/common/. 2019-05-14 14:20:10 -04:00
psprintf.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
relpath.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
restricted_token.c Move logging.h and logging.c from src/fe_utils/ to src/common/. 2019-05-14 14:20:10 -04:00
rmtree.c Initial pgindent run for v12. 2019-05-22 12:55:34 -04:00
ryu_common.h Change floating-point output format for improved performance. 2019-02-13 15:20:33 +00:00
saslprep.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
scram-common.c Fix use of term "verifier" 2019-10-12 21:41:59 +02:00
sha2.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
sha2_openssl.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
string.c Refactor logic to remove trailing CR/LF characters from strings 2019-08-09 11:05:14 +09:00
stringinfo.c Make StringInfo available to frontend code. 2019-11-05 14:56:40 -08:00
unicode_norm.c Update unicode.org URLs 2019-10-13 22:10:38 +02:00
username.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
wait_error.c Update copyright for 2019 2019-01-02 12:44:25 -05:00