postgresql/src/backend/access
Alvaro Herrera 6710e83a67
Remove useless pstrdups in untransformRelOptions
The two strings are already a single palloc'd chunk, not freed; there's
no reason to allocate separate copies that have the same lifetime.

This code is only called in short-lived memory contexts (except in some
cases in TopTransactionContext, which is still short-lived enough not to
really matter), and typically only for short arrays, so the memory or
computation saved is likely negligible.  However, let's fix it to avoid
leaving a bad example of code to copy.  This is the only place I could
find where we're doing this with makeDefElem().

Reported-by: Junwang Zhao <zhjwpku@gmail.com>
Discussion: https://postgr.es/m/20220909142050.3vv2hjekppk265dd@alvherre.pgsql
2022-09-13 11:59:31 +02:00
..
brin Don't reference out-of-bounds array elements in brin_minmax_multi.c 2022-09-13 11:02:56 +12:00
common Remove useless pstrdups in untransformRelOptions 2022-09-13 11:59:31 +02:00
gin Assorted examples of expanded type-safer palloc/pg_malloc API 2022-09-12 08:45:03 +02:00
gist Revert "Convert *GetDatum() and DatumGet*() macros to inline functions" 2022-09-12 19:57:07 +02:00
hash More -Wshadow=compatible-local warning fixes 2022-08-26 02:35:40 +12:00
heap Instrument freezing in autovacuum log reports. 2022-09-08 10:29:39 -07:00
index Update copyright for 2022 2022-01-07 19:04:57 -05:00
nbtree Fix comments about deduplication updating page. 2022-08-05 14:25:49 -07:00
rmgrdesc Fix an assortment of improper usages of string functions 2022-09-06 13:19:44 +12:00
spgist Further -Wshadow=compatible-local warning fixes 2022-08-24 22:04:28 +12:00
table Fix incorrect uses of Datum conversion macros 2022-09-05 13:30:44 +02:00
tablesample Update copyright for 2022 2022-01-07 19:04:57 -05:00
transam Rename macro related to pg_backup_stop() 2022-09-13 10:45:43 +09:00
Makefile Introduce access/{table.h, relation.h}, for generic functions from heapam.h. 2019-01-21 10:51:36 -08:00