Skip to content

Commit 141d2bb

Browse files
committed
builtins: change pg_column_size() to accepts arguments of types.Any
Previously, pg_column_size() required that all arguments have the same type. This patch removes that restriction so that every argument can have a different type. Epic: none Release note (sql change): pg_column_size() no longer requires that all arguments have the same type.
1 parent 994f5d2 commit 141d2bb

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

docs/generated/sql/functions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3500,7 +3500,7 @@ may increase either contention or retry errors, or both.</p>
35003500
</span></td><td>Stable</td></tr>
35013501
<tr><td><a name="pg_column_is_updatable"></a><code>pg_column_is_updatable(reloid: oid, attnum: int2, include_triggers: <a href="bool.html">bool</a>) &rarr; <a href="bool.html">bool</a></code></td><td><span class="funcdesc"><p>Returns whether the given column can be updated.</p>
35023502
</span></td><td>Stable</td></tr>
3503-
<tr><td><a name="pg_column_size"></a><code>pg_column_size(anyelement...) &rarr; <a href="int.html">int</a></code></td><td><span class="funcdesc"><p>Return size in bytes of the column provided as an argument</p>
3503+
<tr><td><a name="pg_column_size"></a><code>pg_column_size(any...) &rarr; <a href="int.html">int</a></code></td><td><span class="funcdesc"><p>Return size in bytes of the column provided as an argument</p>
35043504
</span></td><td>Stable</td></tr>
35053505
<tr><td><a name="pg_function_is_visible"></a><code>pg_function_is_visible(oid: oid) &rarr; <a href="bool.html">bool</a></code></td><td><span class="funcdesc"><p>Returns whether the function with the given OID belongs to one of the schemas on the search path.</p>
35063506
</span></td><td>Stable</td></tr>

pkg/sql/sem/builtins/fixed_oids.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1497,7 +1497,7 @@ var builtinOidsArray = []string{
14971497
1526: `inet_client_port() -> int`,
14981498
1527: `inet_server_addr() -> inet`,
14991499
1528: `inet_server_port() -> int`,
1500-
1529: `pg_column_size(anyelement...) -> int`,
1500+
1529: `pg_column_size(any...) -> int`,
15011501
1530: `information_schema._pg_truetypid(pg_attribute: tuple, pg_type: tuple) -> oid`,
15021502
1531: `information_schema._pg_truetypmod(pg_attribute: tuple, pg_type: tuple) -> int4`,
15031503
1532: `information_schema._pg_char_max_length(typid: oid, typmod: int4) -> int`,

pkg/sql/sem/builtins/pg_builtins.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2044,7 +2044,7 @@ var pgBuiltins = map[string]builtinDefinition{
20442044
"pg_column_size": makeBuiltin(defProps(),
20452045
tree.Overload{
20462046
Types: tree.VariadicType{
2047-
VarType: types.AnyElement,
2047+
VarType: types.Any,
20482048
},
20492049
ReturnType: tree.FixedReturnType(types.Int),
20502050
Fn: func(_ context.Context, _ *eval.Context, args tree.Datums) (tree.Datum, error) {

0 commit comments

Comments
 (0)