Skip to content

Commit 56eb8d4

Browse files
committed
Fix specification of size of vopsd_text column
1 parent b697aa2 commit 56eb8d4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: vops.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -2514,7 +2514,7 @@ Datum vops_populate(PG_FUNCTION_ARGS)
25142514
types[i].tid = vops_get_type(type_id);
25152515
get_typlenbyvalalign(type_id, &types[i].len, &types[i].byval, &types[i].align);
25162516
if (types[i].tid != VOPS_LAST && types[i].len < 0) { /* varying length type: extract size from atttypmod */
2517-
types[i].len = DatumGetInt32(SPI_getbinval(spi_tuple, spi_tupdesc, 3, &is_null)) - VARHDRSZ;
2517+
types[i].len = DatumGetInt32(SPI_getbinval(spi_tuple, spi_tupdesc, 3, &is_null));
25182518
if (types[i].len < 0) {
25192519
elog(ERROR, "Size of column %s is unknown", name);
25202520
}
@@ -2751,7 +2751,7 @@ Datum vops_import(PG_FUNCTION_ARGS)
27512751
}
27522752
get_typlenbyvalalign(type_id, &types[i].len, &types[i].byval, &types[i].align);
27532753
if (types[i].len < 0) { /* varying length type: extract size from atttypmod */
2754-
types[i].len = DatumGetInt32(SPI_getbinval(spi_tuple, spi_tupdesc, 3, &is_null)) - VARHDRSZ;
2754+
types[i].len = DatumGetInt32(SPI_getbinval(spi_tuple, spi_tupdesc, 3, &is_null));
27552755
if (types[i].len < 0) {
27562756
elog(ERROR, "Size of column %s is unknown", name);
27572757
}

0 commit comments

Comments
 (0)