postgresql/contrib/hstore
David Rowley 8b26769bc4 Fix an assortment of improper usages of string functions
In a similar effort to f736e188c and 110d81728, fixup various usages of
string functions where a more appropriate function is available and more
fit for purpose.

These changes include:

1. Use cstring_to_text_with_len() instead of cstring_to_text() when
   working with a StringInfoData and the length can easily be obtained.
2. Use appendStringInfoString() instead of appendStringInfo() when no
   formatting is required.
3. Use pstrdup(...) instead of psprintf("%s", ...)
4. Use pstrdup(...) instead of psprintf(...) (with no formatting)
5. Use appendPQExpBufferChar() instead of appendPQExpBufferStr() when the
   length of the string being appended is 1.
6. appendStringInfoChar() instead of appendStringInfo() when no formatting
   is required and string is 1 char long.
7. Use appendPQExpBufferStr(b, .) instead of appendPQExpBuffer(b, "%s", .)
8. Don't use pstrdup when it's fine to just point to the string constant.

I (David) did find other cases of #8 but opted to use #4 instead as I
wasn't certain enough that applying #8 was ok (e.g in hba.c)

Author: Ranier Vilela, David Rowley
Discussion: https://postgr.es/m/CAApHDvo2j2+RJBGhNtUz6BxabWWh2Jx16wMUMWKUjv70Ver1vg@mail.gmail.com
2022-09-06 13:19:44 +12:00
..
data Add GIN support for pg_trgm. From Guillaume Smet <guillaume.smet@gmail.com> 2007-03-14 14:21:53 +00:00
expected Re-implement pl/pgsql's expression and assignment parsing. 2021-01-04 11:52:00 -05:00
sql Re-implement pl/pgsql's expression and assignment parsing. 2021-01-04 11:52:00 -05:00
.gitignore Support "make check" in contrib 2011-04-25 22:27:11 +03:00
Makefile Allow subscripting of hstore values. 2020-12-11 18:58:21 -05:00
hstore--1.1--1.2.sql Make contrib modules' installation scripts more secure. 2020-08-10 10:44:42 -04:00
hstore--1.2--1.3.sql Introduce jsonb, a structured format for storing json. 2014-03-23 16:40:19 -04:00
hstore--1.3--1.4.sql Make contrib modules' installation scripts more secure. 2020-08-10 10:44:42 -04:00
hstore--1.4--1.5.sql Distinguish selectivity of < from <= and > from >=. 2017-09-13 11:12:39 -04:00
hstore--1.4.sql Update extensions with GIN/GIST support for parallel query. 2016-06-14 13:34:37 -04:00
hstore--1.5--1.6.sql Add a 64-bit hash function for type hstore. 2018-11-23 13:37:34 -05:00
hstore--1.6--1.7.sql Improve selectivity estimation for assorted match-style operators. 2020-04-01 10:32:33 -04:00
hstore--1.7--1.8.sql Remove deprecated containment operators for contrib types. 2021-03-05 10:45:41 -05:00
hstore.control Allow subscripting of hstore values. 2020-12-11 18:58:21 -05:00
hstore.h Mark all symbols exported from extension libraries PGDLLEXPORT. 2022-07-17 18:50:14 -07:00
hstore_compat.c Fix most -Wundef warnings 2019-10-19 18:31:38 +02:00
hstore_gin.c Add construct_array_builtin, deconstruct_array_builtin 2022-07-01 11:23:15 +02:00
hstore_gist.c Add construct_array_builtin, deconstruct_array_builtin 2022-07-01 11:23:15 +02:00
hstore_io.c Fix an assortment of improper usages of string functions 2022-09-06 13:19:44 +12:00
hstore_op.c Fix incorrect uses of Datum conversion macros 2022-09-05 13:30:44 +02:00
hstore_subs.c Update copyright for 2022 2022-01-07 19:04:57 -05:00