Use integer[] for consistency [skip ci]

This commit is contained in:
Andrew Kane
2024-10-13 21:15:46 -07:00
parent 54d91e1116
commit 8d5631da72
7 changed files with 23 additions and 23 deletions

View File

@@ -140,33 +140,33 @@ SELECT '{1e-8,-1e-8}'::real[]::halfvec;
[0,-0]
(1 row)
SELECT '[1,2,3]'::intvec::int[];
SELECT '[1,2,3]'::intvec::integer[];
int4
---------
{1,2,3}
(1 row)
SELECT '{1,2,3}'::int[]::intvec;
SELECT '{1,2,3}'::integer[]::intvec;
intvec
---------
[1,2,3]
(1 row)
SELECT '{1,2,3}'::int[]::intvec(3);
SELECT '{1,2,3}'::integer[]::intvec(3);
intvec
---------
[1,2,3]
(1 row)
SELECT '{1,2,3}'::int[]::intvec(2);
SELECT '{1,2,3}'::integer[]::intvec(2);
ERROR: expected 2 dimensions, not 3
SELECT '{127,-128}'::int[]::intvec;
SELECT '{127,-128}'::integer[]::intvec;
intvec
------------
[127,-128]
(1 row)
SELECT '{128,-129}'::int[]::intvec;
SELECT '{128,-129}'::integer[]::intvec;
ERROR: value "128" is out of range for type intvec
SELECT '[0,1.5,0,3.5,0]'::vector::sparsevec;
sparsevec

View File

@@ -38,13 +38,13 @@ SELECT '{1,2,3}'::real[]::halfvec(2);
SELECT '{65520,-65520}'::real[]::halfvec;
SELECT '{1e-8,-1e-8}'::real[]::halfvec;
SELECT '[1,2,3]'::intvec::int[];
SELECT '[1,2,3]'::intvec::integer[];
SELECT '{1,2,3}'::int[]::intvec;
SELECT '{1,2,3}'::int[]::intvec(3);
SELECT '{1,2,3}'::int[]::intvec(2);
SELECT '{127,-128}'::int[]::intvec;
SELECT '{128,-129}'::int[]::intvec;
SELECT '{1,2,3}'::integer[]::intvec;
SELECT '{1,2,3}'::integer[]::intvec(3);
SELECT '{1,2,3}'::integer[]::intvec(2);
SELECT '{127,-128}'::integer[]::intvec;
SELECT '{128,-129}'::integer[]::intvec;
SELECT '[0,1.5,0,3.5,0]'::vector::sparsevec;
SELECT '[0,1.5,0,3.5,0]'::vector::sparsevec(5);

View File

@@ -41,7 +41,7 @@ for (1 .. 50)
is($expected, $actual);
# Test intvec
$actual = $node->safe_psql("postgres", "SELECT intvec_cmp(v::int[]::intvec, '$query'::int[]::intvec) FROM tst");
$actual = $node->safe_psql("postgres", "SELECT intvec_cmp(v::integer[]::intvec, '$query'::integer[]::intvec) FROM tst");
is($expected, $actual);
# Test sparsevec

View File

@@ -46,7 +46,7 @@ for my $function (@functions)
is($expected, $actual, "halfvec $function");
# Test intvec
$actual = $node->safe_psql("postgres", "SELECT $function(v::real[]::int[]::intvec, '$query'::vector::real[]::int[]::intvec) FROM tst");
$actual = $node->safe_psql("postgres", "SELECT $function(v::real[]::integer[]::intvec, '$query'::vector::real[]::integer[]::intvec) FROM tst");
is($expected, $actual, "intvec $function");
# Test sparsevec