mirror of
https://github.com/postgres/postgres.git
synced 2025-06-16 06:01:02 +03:00
Improve spelling of new FINALFUNC_MODIFY aggregate attribute.
I'd used SHARABLE as a value originally, but Peter Eisentraut points out that dictionaries agree that SHAREABLE is the preferred spelling. Run around and change that before it's too late. Discussion: https://postgr.es/m/d2e1afd4-659c-50d6-1b20-7cfd3675e909@2ndquadrant.com
This commit is contained in:
@ -27,7 +27,7 @@ CREATE AGGREGATE <replaceable class="parameter">name</replaceable> ( [ <replacea
|
|||||||
[ , SSPACE = <replaceable class="parameter">state_data_size</replaceable> ]
|
[ , SSPACE = <replaceable class="parameter">state_data_size</replaceable> ]
|
||||||
[ , FINALFUNC = <replaceable class="parameter">ffunc</replaceable> ]
|
[ , FINALFUNC = <replaceable class="parameter">ffunc</replaceable> ]
|
||||||
[ , FINALFUNC_EXTRA ]
|
[ , FINALFUNC_EXTRA ]
|
||||||
[ , FINALFUNC_MODIFY = { READ_ONLY | SHARABLE | READ_WRITE } ]
|
[ , FINALFUNC_MODIFY = { READ_ONLY | SHAREABLE | READ_WRITE } ]
|
||||||
[ , COMBINEFUNC = <replaceable class="parameter">combinefunc</replaceable> ]
|
[ , COMBINEFUNC = <replaceable class="parameter">combinefunc</replaceable> ]
|
||||||
[ , SERIALFUNC = <replaceable class="parameter">serialfunc</replaceable> ]
|
[ , SERIALFUNC = <replaceable class="parameter">serialfunc</replaceable> ]
|
||||||
[ , DESERIALFUNC = <replaceable class="parameter">deserialfunc</replaceable> ]
|
[ , DESERIALFUNC = <replaceable class="parameter">deserialfunc</replaceable> ]
|
||||||
@ -38,7 +38,7 @@ CREATE AGGREGATE <replaceable class="parameter">name</replaceable> ( [ <replacea
|
|||||||
[ , MSSPACE = <replaceable class="parameter">mstate_data_size</replaceable> ]
|
[ , MSSPACE = <replaceable class="parameter">mstate_data_size</replaceable> ]
|
||||||
[ , MFINALFUNC = <replaceable class="parameter">mffunc</replaceable> ]
|
[ , MFINALFUNC = <replaceable class="parameter">mffunc</replaceable> ]
|
||||||
[ , MFINALFUNC_EXTRA ]
|
[ , MFINALFUNC_EXTRA ]
|
||||||
[ , MFINALFUNC_MODIFY = { READ_ONLY | SHARABLE | READ_WRITE } ]
|
[ , MFINALFUNC_MODIFY = { READ_ONLY | SHAREABLE | READ_WRITE } ]
|
||||||
[ , MINITCOND = <replaceable class="parameter">minitial_condition</replaceable> ]
|
[ , MINITCOND = <replaceable class="parameter">minitial_condition</replaceable> ]
|
||||||
[ , SORTOP = <replaceable class="parameter">sort_operator</replaceable> ]
|
[ , SORTOP = <replaceable class="parameter">sort_operator</replaceable> ]
|
||||||
[ , PARALLEL = { SAFE | RESTRICTED | UNSAFE } ]
|
[ , PARALLEL = { SAFE | RESTRICTED | UNSAFE } ]
|
||||||
@ -51,7 +51,7 @@ CREATE AGGREGATE <replaceable class="parameter">name</replaceable> ( [ [ <replac
|
|||||||
[ , SSPACE = <replaceable class="parameter">state_data_size</replaceable> ]
|
[ , SSPACE = <replaceable class="parameter">state_data_size</replaceable> ]
|
||||||
[ , FINALFUNC = <replaceable class="parameter">ffunc</replaceable> ]
|
[ , FINALFUNC = <replaceable class="parameter">ffunc</replaceable> ]
|
||||||
[ , FINALFUNC_EXTRA ]
|
[ , FINALFUNC_EXTRA ]
|
||||||
[ , FINALFUNC_MODIFY = { READ_ONLY | SHARABLE | READ_WRITE } ]
|
[ , FINALFUNC_MODIFY = { READ_ONLY | SHAREABLE | READ_WRITE } ]
|
||||||
[ , INITCOND = <replaceable class="parameter">initial_condition</replaceable> ]
|
[ , INITCOND = <replaceable class="parameter">initial_condition</replaceable> ]
|
||||||
[ , PARALLEL = { SAFE | RESTRICTED | UNSAFE } ]
|
[ , PARALLEL = { SAFE | RESTRICTED | UNSAFE } ]
|
||||||
[ , HYPOTHETICAL ]
|
[ , HYPOTHETICAL ]
|
||||||
@ -66,7 +66,7 @@ CREATE AGGREGATE <replaceable class="parameter">name</replaceable> (
|
|||||||
[ , SSPACE = <replaceable class="parameter">state_data_size</replaceable> ]
|
[ , SSPACE = <replaceable class="parameter">state_data_size</replaceable> ]
|
||||||
[ , FINALFUNC = <replaceable class="parameter">ffunc</replaceable> ]
|
[ , FINALFUNC = <replaceable class="parameter">ffunc</replaceable> ]
|
||||||
[ , FINALFUNC_EXTRA ]
|
[ , FINALFUNC_EXTRA ]
|
||||||
[ , FINALFUNC_MODIFY = { READ_ONLY | SHARABLE | READ_WRITE } ]
|
[ , FINALFUNC_MODIFY = { READ_ONLY | SHAREABLE | READ_WRITE } ]
|
||||||
[ , COMBINEFUNC = <replaceable class="parameter">combinefunc</replaceable> ]
|
[ , COMBINEFUNC = <replaceable class="parameter">combinefunc</replaceable> ]
|
||||||
[ , SERIALFUNC = <replaceable class="parameter">serialfunc</replaceable> ]
|
[ , SERIALFUNC = <replaceable class="parameter">serialfunc</replaceable> ]
|
||||||
[ , DESERIALFUNC = <replaceable class="parameter">deserialfunc</replaceable> ]
|
[ , DESERIALFUNC = <replaceable class="parameter">deserialfunc</replaceable> ]
|
||||||
@ -77,7 +77,7 @@ CREATE AGGREGATE <replaceable class="parameter">name</replaceable> (
|
|||||||
[ , MSSPACE = <replaceable class="parameter">mstate_data_size</replaceable> ]
|
[ , MSSPACE = <replaceable class="parameter">mstate_data_size</replaceable> ]
|
||||||
[ , MFINALFUNC = <replaceable class="parameter">mffunc</replaceable> ]
|
[ , MFINALFUNC = <replaceable class="parameter">mffunc</replaceable> ]
|
||||||
[ , MFINALFUNC_EXTRA ]
|
[ , MFINALFUNC_EXTRA ]
|
||||||
[ , MFINALFUNC_MODIFY = { READ_ONLY | SHARABLE | READ_WRITE } ]
|
[ , MFINALFUNC_MODIFY = { READ_ONLY | SHAREABLE | READ_WRITE } ]
|
||||||
[ , MINITCOND = <replaceable class="parameter">minitial_condition</replaceable> ]
|
[ , MINITCOND = <replaceable class="parameter">minitial_condition</replaceable> ]
|
||||||
[ , SORTOP = <replaceable class="parameter">sort_operator</replaceable> ]
|
[ , SORTOP = <replaceable class="parameter">sort_operator</replaceable> ]
|
||||||
)
|
)
|
||||||
@ -419,7 +419,7 @@ SELECT col FROM tab ORDER BY col USING sortop LIMIT 1;
|
|||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><literal>FINALFUNC_MODIFY</literal> = { <literal>READ_ONLY</literal> | <literal>SHARABLE</literal> | <literal>READ_WRITE</literal> }</term>
|
<term><literal>FINALFUNC_MODIFY</literal> = { <literal>READ_ONLY</literal> | <literal>SHAREABLE</literal> | <literal>READ_WRITE</literal> }</term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
This option specifies whether the final function is a pure function
|
This option specifies whether the final function is a pure function
|
||||||
@ -585,7 +585,7 @@ SELECT col FROM tab ORDER BY col USING sortop LIMIT 1;
|
|||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><literal>MFINALFUNC_MODIFY</literal> = { <literal>READ_ONLY</literal> | <literal>SHARABLE</literal> | <literal>READ_WRITE</literal> }</term>
|
<term><literal>MFINALFUNC_MODIFY</literal> = { <literal>READ_ONLY</literal> | <literal>SHAREABLE</literal> | <literal>READ_WRITE</literal> }</term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
This option is like <literal>FINALFUNC_MODIFY</literal>, but it describes
|
This option is like <literal>FINALFUNC_MODIFY</literal>, but it describes
|
||||||
@ -678,12 +678,13 @@ SELECT col FROM tab ORDER BY col USING sortop LIMIT 1;
|
|||||||
Likewise, while an aggregate final function is normally expected not to
|
Likewise, while an aggregate final function is normally expected not to
|
||||||
modify its input values, sometimes it is impractical to avoid modifying
|
modify its input values, sometimes it is impractical to avoid modifying
|
||||||
the transition-state argument. Such behavior must be declared using
|
the transition-state argument. Such behavior must be declared using
|
||||||
the <literal>FINALFUNC_MODIFY</literal> parameter. The <literal>READ_WRITE</literal>
|
the <literal>FINALFUNC_MODIFY</literal> parameter.
|
||||||
|
The <literal>READ_WRITE</literal>
|
||||||
value indicates that the final function modifies the transition state in
|
value indicates that the final function modifies the transition state in
|
||||||
unspecified ways. This value prevents use of the aggregate as a window
|
unspecified ways. This value prevents use of the aggregate as a window
|
||||||
function, and it also prevents merging of transition states for aggregate
|
function, and it also prevents merging of transition states for aggregate
|
||||||
calls that share the same input values and transition functions.
|
calls that share the same input values and transition functions.
|
||||||
The <literal>SHARABLE</literal> value indicates that the transition function
|
The <literal>SHAREABLE</literal> value indicates that the transition function
|
||||||
cannot be applied after the final function, but multiple final-function
|
cannot be applied after the final function, but multiple final-function
|
||||||
calls can be performed on the ending transition state value. This value
|
calls can be performed on the ending transition state value. This value
|
||||||
prevents use of the aggregate as a window function, but it allows merging
|
prevents use of the aggregate as a window function, but it allows merging
|
||||||
|
@ -491,8 +491,8 @@ SELECT percentile_disc(0.5) WITHIN GROUP (ORDER BY income) FROM households;
|
|||||||
to continue adding input rows by executing the transition function again
|
to continue adding input rows by executing the transition function again
|
||||||
later. This means the final function is not <literal>READ_ONLY</literal>;
|
later. This means the final function is not <literal>READ_ONLY</literal>;
|
||||||
it must be declared in <xref linkend="sql-createaggregate"/>
|
it must be declared in <xref linkend="sql-createaggregate"/>
|
||||||
as <literal>READ_WRITE</literal>, or as <literal>SHARABLE</literal> if it's
|
as <literal>READ_WRITE</literal>, or as <literal>SHAREABLE</literal> if
|
||||||
possible for additional final-function calls to make use of the
|
it's possible for additional final-function calls to make use of the
|
||||||
already-sorted state.
|
already-sorted state.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
|
@ -477,13 +477,13 @@ extractModify(DefElem *defel)
|
|||||||
|
|
||||||
if (strcmp(val, "read_only") == 0)
|
if (strcmp(val, "read_only") == 0)
|
||||||
return AGGMODIFY_READ_ONLY;
|
return AGGMODIFY_READ_ONLY;
|
||||||
if (strcmp(val, "sharable") == 0)
|
if (strcmp(val, "shareable") == 0)
|
||||||
return AGGMODIFY_SHARABLE;
|
return AGGMODIFY_SHAREABLE;
|
||||||
if (strcmp(val, "read_write") == 0)
|
if (strcmp(val, "read_write") == 0)
|
||||||
return AGGMODIFY_READ_WRITE;
|
return AGGMODIFY_READ_WRITE;
|
||||||
ereport(ERROR,
|
ereport(ERROR,
|
||||||
(errcode(ERRCODE_SYNTAX_ERROR),
|
(errcode(ERRCODE_SYNTAX_ERROR),
|
||||||
errmsg("parameter \"%s\" must be READ_ONLY, SHARABLE, or READ_WRITE",
|
errmsg("parameter \"%s\" must be READ_ONLY, SHAREABLE, or READ_WRITE",
|
||||||
defel->defname)));
|
defel->defname)));
|
||||||
return 0; /* keep compiler quiet */
|
return 0; /* keep compiler quiet */
|
||||||
}
|
}
|
||||||
|
@ -288,7 +288,7 @@ static void build_pertrans_for_aggref(AggStatePerTrans pertrans,
|
|||||||
static int find_compatible_peragg(Aggref *newagg, AggState *aggstate,
|
static int find_compatible_peragg(Aggref *newagg, AggState *aggstate,
|
||||||
int lastaggno, List **same_input_transnos);
|
int lastaggno, List **same_input_transnos);
|
||||||
static int find_compatible_pertrans(AggState *aggstate, Aggref *newagg,
|
static int find_compatible_pertrans(AggState *aggstate, Aggref *newagg,
|
||||||
bool sharable,
|
bool shareable,
|
||||||
Oid aggtransfn, Oid aggtranstype,
|
Oid aggtransfn, Oid aggtranstype,
|
||||||
Oid aggserialfn, Oid aggdeserialfn,
|
Oid aggserialfn, Oid aggdeserialfn,
|
||||||
Datum initValue, bool initValueIsNull,
|
Datum initValue, bool initValueIsNull,
|
||||||
@ -2522,7 +2522,7 @@ ExecInitAgg(Agg *node, EState *estate, int eflags)
|
|||||||
AclResult aclresult;
|
AclResult aclresult;
|
||||||
Oid transfn_oid,
|
Oid transfn_oid,
|
||||||
finalfn_oid;
|
finalfn_oid;
|
||||||
bool sharable;
|
bool shareable;
|
||||||
Oid serialfn_oid,
|
Oid serialfn_oid,
|
||||||
deserialfn_oid;
|
deserialfn_oid;
|
||||||
Expr *finalfnexpr;
|
Expr *finalfnexpr;
|
||||||
@ -2597,12 +2597,12 @@ ExecInitAgg(Agg *node, EState *estate, int eflags)
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* If finalfn is marked read-write, we can't share transition states;
|
* If finalfn is marked read-write, we can't share transition states;
|
||||||
* but it is okay to share states for AGGMODIFY_SHARABLE aggs. Also,
|
* but it is okay to share states for AGGMODIFY_SHAREABLE aggs. Also,
|
||||||
* if we're not executing the finalfn here, we can share regardless.
|
* if we're not executing the finalfn here, we can share regardless.
|
||||||
*/
|
*/
|
||||||
sharable = (aggform->aggfinalmodify != AGGMODIFY_READ_WRITE) ||
|
shareable = (aggform->aggfinalmodify != AGGMODIFY_READ_WRITE) ||
|
||||||
(finalfn_oid == InvalidOid);
|
(finalfn_oid == InvalidOid);
|
||||||
peragg->sharable = sharable;
|
peragg->shareable = shareable;
|
||||||
|
|
||||||
serialfn_oid = InvalidOid;
|
serialfn_oid = InvalidOid;
|
||||||
deserialfn_oid = InvalidOid;
|
deserialfn_oid = InvalidOid;
|
||||||
@ -2746,12 +2746,12 @@ ExecInitAgg(Agg *node, EState *estate, int eflags)
|
|||||||
* 2. Build working state for invoking the transition function, or
|
* 2. Build working state for invoking the transition function, or
|
||||||
* look up previously initialized working state, if we can share it.
|
* look up previously initialized working state, if we can share it.
|
||||||
*
|
*
|
||||||
* find_compatible_peragg() already collected a list of sharable
|
* find_compatible_peragg() already collected a list of shareable
|
||||||
* per-Trans's with the same inputs. Check if any of them have the
|
* per-Trans's with the same inputs. Check if any of them have the
|
||||||
* same transition function and initial value.
|
* same transition function and initial value.
|
||||||
*/
|
*/
|
||||||
existing_transno = find_compatible_pertrans(aggstate, aggref,
|
existing_transno = find_compatible_pertrans(aggstate, aggref,
|
||||||
sharable,
|
shareable,
|
||||||
transfn_oid, aggtranstype,
|
transfn_oid, aggtranstype,
|
||||||
serialfn_oid, deserialfn_oid,
|
serialfn_oid, deserialfn_oid,
|
||||||
initValue, initValueIsNull,
|
initValue, initValueIsNull,
|
||||||
@ -3170,7 +3170,7 @@ GetAggInitVal(Datum textInitVal, Oid transtype)
|
|||||||
* with this one, with the same input parameters. If no compatible aggregate
|
* with this one, with the same input parameters. If no compatible aggregate
|
||||||
* can be found, returns -1.
|
* can be found, returns -1.
|
||||||
*
|
*
|
||||||
* As a side-effect, this also collects a list of existing, sharable per-Trans
|
* As a side-effect, this also collects a list of existing, shareable per-Trans
|
||||||
* structs with matching inputs. If no identical Aggref is found, the list is
|
* structs with matching inputs. If no identical Aggref is found, the list is
|
||||||
* passed later to find_compatible_pertrans, to see if we can at least reuse
|
* passed later to find_compatible_pertrans, to see if we can at least reuse
|
||||||
* the state value of another aggregate.
|
* the state value of another aggregate.
|
||||||
@ -3237,7 +3237,7 @@ find_compatible_peragg(Aggref *newagg, AggState *aggstate,
|
|||||||
* we might report a transno more than once. find_compatible_pertrans
|
* we might report a transno more than once. find_compatible_pertrans
|
||||||
* is cheap enough that it's not worth spending cycles to avoid that.)
|
* is cheap enough that it's not worth spending cycles to avoid that.)
|
||||||
*/
|
*/
|
||||||
if (peragg->sharable)
|
if (peragg->shareable)
|
||||||
*same_input_transnos = lappend_int(*same_input_transnos,
|
*same_input_transnos = lappend_int(*same_input_transnos,
|
||||||
peragg->transno);
|
peragg->transno);
|
||||||
}
|
}
|
||||||
@ -3254,7 +3254,7 @@ find_compatible_peragg(Aggref *newagg, AggState *aggstate,
|
|||||||
* verified to match.)
|
* verified to match.)
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
find_compatible_pertrans(AggState *aggstate, Aggref *newagg, bool sharable,
|
find_compatible_pertrans(AggState *aggstate, Aggref *newagg, bool shareable,
|
||||||
Oid aggtransfn, Oid aggtranstype,
|
Oid aggtransfn, Oid aggtranstype,
|
||||||
Oid aggserialfn, Oid aggdeserialfn,
|
Oid aggserialfn, Oid aggdeserialfn,
|
||||||
Datum initValue, bool initValueIsNull,
|
Datum initValue, bool initValueIsNull,
|
||||||
@ -3263,7 +3263,7 @@ find_compatible_pertrans(AggState *aggstate, Aggref *newagg, bool sharable,
|
|||||||
ListCell *lc;
|
ListCell *lc;
|
||||||
|
|
||||||
/* If this aggregate can't share transition states, give up */
|
/* If this aggregate can't share transition states, give up */
|
||||||
if (!sharable)
|
if (!shareable)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
foreach(lc, transnos)
|
foreach(lc, transnos)
|
||||||
|
@ -13833,8 +13833,8 @@ dumpAgg(Archive *fout, AggInfo *agginfo)
|
|||||||
case AGGMODIFY_READ_ONLY:
|
case AGGMODIFY_READ_ONLY:
|
||||||
appendPQExpBufferStr(details, ",\n FINALFUNC_MODIFY = READ_ONLY");
|
appendPQExpBufferStr(details, ",\n FINALFUNC_MODIFY = READ_ONLY");
|
||||||
break;
|
break;
|
||||||
case AGGMODIFY_SHARABLE:
|
case AGGMODIFY_SHAREABLE:
|
||||||
appendPQExpBufferStr(details, ",\n FINALFUNC_MODIFY = SHARABLE");
|
appendPQExpBufferStr(details, ",\n FINALFUNC_MODIFY = SHAREABLE");
|
||||||
break;
|
break;
|
||||||
case AGGMODIFY_READ_WRITE:
|
case AGGMODIFY_READ_WRITE:
|
||||||
appendPQExpBufferStr(details, ",\n FINALFUNC_MODIFY = READ_WRITE");
|
appendPQExpBufferStr(details, ",\n FINALFUNC_MODIFY = READ_WRITE");
|
||||||
@ -13889,8 +13889,8 @@ dumpAgg(Archive *fout, AggInfo *agginfo)
|
|||||||
case AGGMODIFY_READ_ONLY:
|
case AGGMODIFY_READ_ONLY:
|
||||||
appendPQExpBufferStr(details, ",\n MFINALFUNC_MODIFY = READ_ONLY");
|
appendPQExpBufferStr(details, ",\n MFINALFUNC_MODIFY = READ_ONLY");
|
||||||
break;
|
break;
|
||||||
case AGGMODIFY_SHARABLE:
|
case AGGMODIFY_SHAREABLE:
|
||||||
appendPQExpBufferStr(details, ",\n MFINALFUNC_MODIFY = SHARABLE");
|
appendPQExpBufferStr(details, ",\n MFINALFUNC_MODIFY = SHAREABLE");
|
||||||
break;
|
break;
|
||||||
case AGGMODIFY_READ_WRITE:
|
case AGGMODIFY_READ_WRITE:
|
||||||
appendPQExpBufferStr(details, ",\n MFINALFUNC_MODIFY = READ_WRITE");
|
appendPQExpBufferStr(details, ",\n MFINALFUNC_MODIFY = READ_WRITE");
|
||||||
|
@ -1431,7 +1431,7 @@ my %tests = (
|
|||||||
basetype = int4,
|
basetype = int4,
|
||||||
stype = _int8,
|
stype = _int8,
|
||||||
finalfunc = int8_avg,
|
finalfunc = int8_avg,
|
||||||
finalfunc_modify = sharable,
|
finalfunc_modify = shareable,
|
||||||
initcond1 = \'{0,0}\'
|
initcond1 = \'{0,0}\'
|
||||||
);',
|
);',
|
||||||
regexp => qr/^
|
regexp => qr/^
|
||||||
@ -1440,7 +1440,7 @@ my %tests = (
|
|||||||
\n\s+\QSTYPE = bigint[],\E
|
\n\s+\QSTYPE = bigint[],\E
|
||||||
\n\s+\QINITCOND = '{0,0}',\E
|
\n\s+\QINITCOND = '{0,0}',\E
|
||||||
\n\s+\QFINALFUNC = int8_avg,\E
|
\n\s+\QFINALFUNC = int8_avg,\E
|
||||||
\n\s+\QFINALFUNC_MODIFY = SHARABLE\E
|
\n\s+\QFINALFUNC_MODIFY = SHAREABLE\E
|
||||||
\n\);/xm,
|
\n\);/xm,
|
||||||
like => {
|
like => {
|
||||||
%full_runs,
|
%full_runs,
|
||||||
|
@ -134,7 +134,7 @@ typedef FormData_pg_aggregate *Form_pg_aggregate;
|
|||||||
* transfn cannot be applied anymore after the first finalfn call.
|
* transfn cannot be applied anymore after the first finalfn call.
|
||||||
*/
|
*/
|
||||||
#define AGGMODIFY_READ_ONLY 'r'
|
#define AGGMODIFY_READ_ONLY 'r'
|
||||||
#define AGGMODIFY_SHARABLE 's'
|
#define AGGMODIFY_SHAREABLE 's'
|
||||||
#define AGGMODIFY_READ_WRITE 'w'
|
#define AGGMODIFY_READ_WRITE 'w'
|
||||||
|
|
||||||
#endif /* EXPOSE_TO_CLIENT_CODE */
|
#endif /* EXPOSE_TO_CLIENT_CODE */
|
||||||
|
@ -216,10 +216,10 @@ typedef struct AggStatePerAggData
|
|||||||
bool resulttypeByVal;
|
bool resulttypeByVal;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* "sharable" is false if this agg cannot share state values with other
|
* "shareable" is false if this agg cannot share state values with other
|
||||||
* aggregates because the final function is read-write.
|
* aggregates because the final function is read-write.
|
||||||
*/
|
*/
|
||||||
bool sharable;
|
bool shareable;
|
||||||
} AggStatePerAggData;
|
} AggStatePerAggData;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -148,7 +148,7 @@ CREATE AGGREGATE myavg (numeric)
|
|||||||
serialfunc = numeric_avg_serialize,
|
serialfunc = numeric_avg_serialize,
|
||||||
deserialfunc = numeric_avg_deserialize,
|
deserialfunc = numeric_avg_deserialize,
|
||||||
combinefunc = numeric_avg_combine,
|
combinefunc = numeric_avg_combine,
|
||||||
finalfunc_modify = sharable -- just to test a non-default setting
|
finalfunc_modify = shareable -- just to test a non-default setting
|
||||||
);
|
);
|
||||||
-- Ensure all these functions made it into the catalog
|
-- Ensure all these functions made it into the catalog
|
||||||
SELECT aggfnoid, aggtransfn, aggcombinefn, aggtranstype::regtype,
|
SELECT aggfnoid, aggtransfn, aggcombinefn, aggtranstype::regtype,
|
||||||
|
@ -163,7 +163,7 @@ CREATE AGGREGATE myavg (numeric)
|
|||||||
serialfunc = numeric_avg_serialize,
|
serialfunc = numeric_avg_serialize,
|
||||||
deserialfunc = numeric_avg_deserialize,
|
deserialfunc = numeric_avg_deserialize,
|
||||||
combinefunc = numeric_avg_combine,
|
combinefunc = numeric_avg_combine,
|
||||||
finalfunc_modify = sharable -- just to test a non-default setting
|
finalfunc_modify = shareable -- just to test a non-default setting
|
||||||
);
|
);
|
||||||
|
|
||||||
-- Ensure all these functions made it into the catalog
|
-- Ensure all these functions made it into the catalog
|
||||||
|
Reference in New Issue
Block a user