aboutsummaryrefslogtreecommitdiff
path: root/src/backend/tcop/postgres.c
diff options
context:
space:
mode:
authorPeter Eisentraut <peter@eisentraut.org>2019-03-14 13:30:09 +0100
committerPeter Eisentraut <peter@eisentraut.org>2019-03-14 13:30:09 +0100
commitc6ff0b892c30122b75d32c524109d16ee3c973f0 (patch)
treec01cf8fe3258deb6a28af5e7d28a4ea81eda6077 /src/backend/tcop/postgres.c
parent1226d932b4dadc39ba2f9a488e4d784443ea6a78 (diff)
downloadpostgresql-c6ff0b892c30122b75d32c524109d16ee3c973f0.tar.gz
postgresql-c6ff0b892c30122b75d32c524109d16ee3c973f0.zip
Refactor ParamListInfo initialization
There were six copies of identical nontrivial code. Put it into a function.
Diffstat (limited to 'src/backend/tcop/postgres.c')
-rw-r--r--src/backend/tcop/postgres.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c
index 8b4d94c9a13..f9ce3d8f22a 100644
--- a/src/backend/tcop/postgres.c
+++ b/src/backend/tcop/postgres.c
@@ -1731,16 +1731,7 @@ exec_bind_message(StringInfo input_message)
*/
if (numParams > 0)
{
- params = (ParamListInfo) palloc(offsetof(ParamListInfoData, params) +
- numParams * sizeof(ParamExternData));
- /* we have static list of params, so no hooks needed */
- params->paramFetch = NULL;
- params->paramFetchArg = NULL;
- params->paramCompile = NULL;
- params->paramCompileArg = NULL;
- params->parserSetup = NULL;
- params->parserSetupArg = NULL;
- params->numParams = numParams;
+ params = makeParamList(numParams);
for (int paramno = 0; paramno < numParams; paramno++)
{