mirror of
https://github.com/pgvector/pgvector.git
synced 2026-07-12 15:46:54 +08:00
Improved test [skip ci]
This commit is contained in:
@@ -12,11 +12,11 @@ $node->start;
|
|||||||
# Create table
|
# Create table
|
||||||
$node->safe_psql("postgres", "CREATE EXTENSION vector;");
|
$node->safe_psql("postgres", "CREATE EXTENSION vector;");
|
||||||
$node->safe_psql("postgres", "CREATE TABLE tst (r1 real, r2 real, r3 real, v vector(3));");
|
$node->safe_psql("postgres", "CREATE TABLE tst (r1 real, r2 real, r3 real, v vector(3));");
|
||||||
$node->safe_psql("postgres",
|
$node->safe_psql("postgres", qq(
|
||||||
"INSERT INTO tst SELECT r1, r2, r3, ARRAY[r1, r2, r3] FROM (
|
INSERT INTO tst SELECT r1, r2, r3, ARRAY[r1, r2, r3] FROM (
|
||||||
SELECT random() + 1.01 AS r1, random() + 2.01 AS r2, random() + 3.01 AS r3 FROM generate_series(1, 1000000) t
|
SELECT random() + 1.01 AS r1, random() + 2.01 AS r2, random() + 3.01 AS r3 FROM generate_series(1, 1000000) t
|
||||||
) i;"
|
) i;
|
||||||
);
|
));
|
||||||
|
|
||||||
# Test matches real
|
# Test matches real
|
||||||
my $r1 = $node->safe_psql("postgres", "SELECT AVG(r1)::float4 FROM tst;");
|
my $r1 = $node->safe_psql("postgres", "SELECT AVG(r1)::float4 FROM tst;");
|
||||||
|
|||||||
Reference in New Issue
Block a user