Re: Re: proposal: schema variables - Mailing list pgsql-hackers

From Pavel Stehule
Subject Re: Re: proposal: schema variables
Date
Msg-id CAFj8pRBFpVZ7ZpB9G5MkePVFGHFRuq6b_iRufTg2HibX5hnzRA@mail.gmail.com
Whole thread Raw
In response to Re: Re: proposal: schema variables  (jian he <jian.universality@gmail.com>)
List pgsql-hackers


ne 5. 1. 2025 v 17:11 odesílatel jian he <jian.universality@gmail.com> napsal:
+ /*
+ * The arguments of EXECUTE are evaluated by a direct expression
+ * executor call.  This mode doesn't support session variables yet.
+ * It will be enabled later.
+ */
+ if (pstate->p_hasSessionVariables)
+ elog(ERROR, "session variable cannot be used as an argument");

it should be:
    /*
     * The arguments of CALL statement are evaluated by a direct expression
     * executor call.  This path is unsupported yet, so block it.
     */
    if (pstate->p_hasSessionVariables)
        ereport(ERROR,
                errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
                errmsg("session variable cannot be used as an argument"));

done
 

similarly, EvaluateParams we can change it to
    /*
     * The arguments of EXECUTE are evaluated by a direct expression
     * executor call.  This mode doesn't support session variables yet.
     * It will be enabled later.
     */
    if (pstate->p_hasSessionVariables)
        ereport(ERROR,
                errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
                errmsg("session variable cannot be used as an argument"));

done
 

in src/backend/executor/execExpr.c
we don't need
+#include "catalog/pg_variable.h"
?

moved to patch 16
 

pgsql-hackers by date:

Previous
From: Julien Rouhaud
Date:
Subject: Re: RFC: Allow EXPLAIN to Output Page Fault Information
Next
From: Ashutosh Bapat
Date:
Subject: Re: POC: enable logical decoding when wal_level = 'replica' without a server restart