Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sync tests
Browse files Browse the repository at this point in the history
olirice committed Jan 9, 2025
1 parent 9f4888f commit aff4edf
Showing 25 changed files with 12,178 additions and 6,496 deletions.
5 changes: 1 addition & 4 deletions nix/tests/expected/pg_tle.out
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
set client_min_messages = warning;
select
pgtle.install_extension(
'pg_distance',
@@ -88,8 +89,4 @@ select

-- Restore original state if any of the above fails
drop extension pg_tle cascade;
-- temporarily disable notice messages becuase they differ between 15 and 17
set client_min_messages = warning;
create extension pg_tle;
-- restore notice messages
reset client_min_messages;
10,729 changes: 5,674 additions & 5,055 deletions nix/tests/expected/ext_interface.out → nix/tests/expected/z_15_ext_interface.out

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions nix/tests/expected/z_15_pg_stat_monitor.out
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ from
pg_stat_monitor
where
false;
bucket | bucket_start_time | userid | username | dbid | datname | client_ip | pgsm_query_id | queryid | toplevel | top_queryid | query | comments | planid | query_plan | top_query | application_name | relations | cmd_type | cmd_type_text | elevel | sqlcode | message | calls | total_exec_time | min_exec_time | max_exec_time | mean_exec_time | stddev_exec_time | rows | shared_blks_hit | shared_blks_read | shared_blks_dirtied | shared_blks_written | local_blks_hit | local_blks_read | local_blks_dirtied | local_blks_written | temp_blks_read | temp_blks_written | shared_blk_read_time | shared_blk_write_time | local_blk_read_time | local_blk_write_time | temp_blk_read_time | temp_blk_write_time | resp_calls | cpu_user_time | cpu_sys_time | wal_records | wal_fpi | wal_bytes | bucket_done | plans | total_plan_time | min_plan_time | max_plan_time | mean_plan_time | stddev_plan_time | jit_functions | jit_generation_time | jit_inlining_count | jit_inlining_time | jit_optimization_count | jit_optimization_time | jit_emission_count | jit_emission_time | jit_deform_count | jit_deform_time | stats_since | minmax_stats_since
--------+-------------------+--------+----------+------+---------+-----------+---------------+---------+----------+-------------+-------+----------+--------+------------+-----------+------------------+-----------+----------+---------------+--------+---------+---------+-------+-----------------+---------------+---------------+----------------+------------------+------+-----------------+------------------+---------------------+---------------------+----------------+-----------------+--------------------+--------------------+----------------+-------------------+----------------------+-----------------------+---------------------+----------------------+--------------------+---------------------+------------+---------------+--------------+-------------+---------+-----------+-------------+-------+-----------------+---------------+---------------+----------------+------------------+---------------+---------------------+--------------------+-------------------+------------------------+-----------------------+--------------------+-------------------+------------------+-----------------+-------------+--------------------
bucket | bucket_start_time | userid | username | dbid | datname | client_ip | pgsm_query_id | queryid | toplevel | top_queryid | query | comments | planid | query_plan | top_query | application_name | relations | cmd_type | cmd_type_text | elevel | sqlcode | message | calls | total_exec_time | min_exec_time | max_exec_time | mean_exec_time | stddev_exec_time | rows | shared_blks_hit | shared_blks_read | shared_blks_dirtied | shared_blks_written | local_blks_hit | local_blks_read | local_blks_dirtied | local_blks_written | temp_blks_read | temp_blks_written | blk_read_time | blk_write_time | temp_blk_read_time | temp_blk_write_time | resp_calls | cpu_user_time | cpu_sys_time | wal_records | wal_fpi | wal_bytes | bucket_done | plans | total_plan_time | min_plan_time | max_plan_time | mean_plan_time | stddev_plan_time | jit_functions | jit_generation_time | jit_inlining_count | jit_inlining_time | jit_optimization_count | jit_optimization_time | jit_emission_count | jit_emission_time
--------+-------------------+--------+----------+------+---------+-----------+---------------+---------+----------+-------------+-------+----------+--------+------------+-----------+------------------+-----------+----------+---------------+--------+---------+---------+-------+-----------------+---------------+---------------+----------------+------------------+------+-----------------+------------------+---------------------+---------------------+----------------+-----------------+--------------------+--------------------+----------------+-------------------+---------------+----------------+--------------------+---------------------+------------+---------------+--------------+-------------+---------+-----------+-------------+-------+-----------------+---------------+---------------+----------------+------------------+---------------+---------------------+--------------------+-------------------+------------------------+-----------------------+--------------------+-------------------
(0 rows)

File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
/*
This test mirrors ext_interface.sql for extensions that are not yet compatible
with OrioleDB

This extension is not supported because it includes an unsupported index type
This extension is excluded from oriole-17 because it uses an unsupported index type
*/
create extension if not exists postgis_tiger_geocoder;
select
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
This test is TEMPORARILY excluded from the Postgres 17 suite until OrioleDB is able to support RUM indexes
This extension is excluded from oriole-17 because it uses an unsupported index type
*/
create schema v;
create table v.test_rum(
File renamed without changes.
701 changes: 0 additions & 701 deletions nix/tests/expected/z_17_dep_ext_interface.out

This file was deleted.

701 changes: 0 additions & 701 deletions nix/tests/expected/z_17_deprecated_ext_interface.out

This file was deleted.

6,333 changes: 6,333 additions & 0 deletions nix/tests/expected/z_17_ext_interface.out

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions nix/tests/expected/z_17_pg_stat_monitor.out
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ from
pg_stat_monitor
where
false;
bucket | bucket_start_time | userid | username | dbid | datname | client_ip | pgsm_query_id | queryid | toplevel | top_queryid | query | comments | planid | query_plan | top_query | application_name | relations | cmd_type | cmd_type_text | elevel | sqlcode | message | calls | total_exec_time | min_exec_time | max_exec_time | mean_exec_time | stddev_exec_time | rows | shared_blks_hit | shared_blks_read | shared_blks_dirtied | shared_blks_written | local_blks_hit | local_blks_read | local_blks_dirtied | local_blks_written | temp_blks_read | temp_blks_written | blk_read_time | blk_write_time | temp_blk_read_time | temp_blk_write_time | resp_calls | cpu_user_time | cpu_sys_time | wal_records | wal_fpi | wal_bytes | bucket_done | plans | total_plan_time | min_plan_time | max_plan_time | mean_plan_time | stddev_plan_time | jit_functions | jit_generation_time | jit_inlining_count | jit_inlining_time | jit_optimization_count | jit_optimization_time | jit_emission_count | jit_emission_time
--------+-------------------+--------+----------+------+---------+-----------+---------------+---------+----------+-------------+-------+----------+--------+------------+-----------+------------------+-----------+----------+---------------+--------+---------+---------+-------+-----------------+---------------+---------------+----------------+------------------+------+-----------------+------------------+---------------------+---------------------+----------------+-----------------+--------------------+--------------------+----------------+-------------------+---------------+----------------+--------------------+---------------------+------------+---------------+--------------+-------------+---------+-----------+-------------+-------+-----------------+---------------+---------------+----------------+------------------+---------------+---------------------+--------------------+-------------------+------------------------+-----------------------+--------------------+-------------------
bucket | bucket_start_time | userid | username | dbid | datname | client_ip | pgsm_query_id | queryid | toplevel | top_queryid | query | comments | planid | query_plan | top_query | application_name | relations | cmd_type | cmd_type_text | elevel | sqlcode | message | calls | total_exec_time | min_exec_time | max_exec_time | mean_exec_time | stddev_exec_time | rows | shared_blks_hit | shared_blks_read | shared_blks_dirtied | shared_blks_written | local_blks_hit | local_blks_read | local_blks_dirtied | local_blks_written | temp_blks_read | temp_blks_written | shared_blk_read_time | shared_blk_write_time | local_blk_read_time | local_blk_write_time | temp_blk_read_time | temp_blk_write_time | resp_calls | cpu_user_time | cpu_sys_time | wal_records | wal_fpi | wal_bytes | bucket_done | plans | total_plan_time | min_plan_time | max_plan_time | mean_plan_time | stddev_plan_time | jit_functions | jit_generation_time | jit_inlining_count | jit_inlining_time | jit_optimization_count | jit_optimization_time | jit_emission_count | jit_emission_time | jit_deform_count | jit_deform_time | stats_since | minmax_stats_since
--------+-------------------+--------+----------+------+---------+-----------+---------------+---------+----------+-------------+-------+----------+--------+------------+-----------+------------------+-----------+----------+---------------+--------+---------+---------+-------+-----------------+---------------+---------------+----------------+------------------+------+-----------------+------------------+---------------------+---------------------+----------------+-----------------+--------------------+--------------------+----------------+-------------------+----------------------+-----------------------+---------------------+----------------------+--------------------+---------------------+------------+---------------+--------------+-------------+---------+-----------+-------------+-------+-----------------+---------------+---------------+----------------+------------------+---------------+---------------------+--------------------+-------------------+------------------------+-----------------------+--------------------+-------------------+------------------+-----------------+-------------+--------------------
(0 rows)

59 changes: 59 additions & 0 deletions nix/tests/expected/z_17_pgvector.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/*
This test excludes indexes shipped with pgvector because orioledb doesn't support them yet
*/
create schema v;
create table v.items(
id serial primary key,
embedding vector(3),
half_embedding halfvec(3),
bit_embedding bit(3),
sparse_embedding sparsevec(3)
);
-- Populate some records
insert into v.items(
embedding,
half_embedding,
bit_embedding,
sparse_embedding
)
values
('[1,2,3]', '[1,2,3]', '101', '{1:4}/3'),
('[2,3,4]', '[2,3,4]', '010', '{1:7,3:0}/3');
-- Test op types
select
*
from
v.items
order by
embedding <-> '[2,3,5]',
embedding <=> '[2,3,5]',
embedding <+> '[2,3,5]',
embedding <#> '[2,3,5]',
half_embedding <-> '[2,3,5]',
half_embedding <=> '[2,3,5]',
half_embedding <+> '[2,3,5]',
half_embedding <#> '[2,3,5]',
sparse_embedding <-> '{2:4,3:1}/3',
sparse_embedding <=> '{2:4,3:1}/3',
sparse_embedding <+> '{2:4,3:1}/3',
sparse_embedding <#> '{2:4,3:1}/3',
bit_embedding <~> '011';
id | embedding | half_embedding | bit_embedding | sparse_embedding
----+-----------+----------------+---------------+------------------
2 | [2,3,4] | [2,3,4] | 010 | {1:7}/3
1 | [1,2,3] | [1,2,3] | 101 | {1:4}/3
(2 rows)

select
avg(embedding),
avg(half_embedding)
from
v.items;
avg | avg
---------------+---------------
[1.5,2.5,3.5] | [1.5,2.5,3.5]
(1 row)

-- Cleanup
drop schema v cascade;
NOTICE: drop cascades to table v.items
3 changes: 3 additions & 0 deletions nix/tests/prime.sql
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
-- disable notice messages becuase they differ between 15 and 17
set client_min_messages = warning;

create extension if not exists address_standardizer;
create extension if not exists address_standardizer_data_us;
create extension if not exists amcheck;
8 changes: 2 additions & 6 deletions nix/tests/sql/pg_tle.sql
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
set client_min_messages = warning;

select
pgtle.install_extension(
'pg_distance',
@@ -68,10 +70,4 @@ select
-- Restore original state if any of the above fails
drop extension pg_tle cascade;

-- temporarily disable notice messages becuase they differ between 15 and 17
set client_min_messages = warning;

create extension pg_tle;

-- restore notice messages
reset client_min_messages;
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
/*
This test mirrors ext_interface.sql for extensions that do not ship with
the Postgres 17 image
The purpose of this test is to monitor the SQL interface exposed
by Postgres extensions so we have to manually review/approve any difference
that emerge as versions change.
*/


/*
List all extensions that are not enabled
If a new entry shows up in this list, that means a new extension has been
added and you should `create extension ...` to enable it in ./nix/tests/prime
*/
create extension if not exists adminpack;
create extension if not exists plv8;
@@ -9,32 +21,39 @@ create extension if not exists plls;
create extension if not exists old_snapshot;
create extension if not exists timescaledb;


select
name
from
pg_available_extensions
where
installed_version is null
and name in (
'adminpack', 'plv8', 'plls', 'plcoffee', 'old_snapshot', 'timescaledb'
)
order by
name asc;


/*
Monitor relocatability and config of each extension
- lesson learned from pg_cron
*/

select
extname as extension_name,
extrelocatable as is_relocatable
from
pg_extension
where
e.extname in (
'adminpack', 'plv8', 'plls', 'plcoffee', 'old_snapshot', 'timescaledb'
)
order by
extname asc;


/*
Monitor extension public function interface
*/

select
e.extname as extension_name,
n.nspname as schema_name,
@@ -51,15 +70,30 @@ from
on e.oid = d.refobjid
where
d.deptype = 'e'
and e.extname in (
'adminpack', 'plv8', 'plls', 'plcoffee', 'old_snapshot', 'timescaledb'
)
-- Filter out changes between pg15 and pg16 from extensions that ship with postgres
-- new in pg16
and not (e.extname = 'fuzzystrmatch' and p.proname = 'daitch_mokotoff')
and not (e.extname = 'pageinspect' and p.proname = 'bt_multi_page_stats')
and not (e.extname = 'pg_buffercache' and p.proname = 'pg_buffercache_summary')
and not (e.extname = 'pg_buffercache' and p.proname = 'pg_buffercache_usage_counts')
and not (e.extname = 'pg_walinspect' and p.proname = 'pg_get_wal_block_info')
-- removed in pg16
and not (e.extname = 'pg_walinspect' and p.proname = 'pg_get_wal_records_info_till_end_of_wal')
and not (e.extname = 'pg_walinspect' and p.proname = 'pg_get_wal_stats_till_end_of_wal')
-- changed in pg16 - output signature added a column
and not (e.extname = 'pageinspect' and p.proname = 'brin_page_items')
order by
e.extname,
n.nspname,
p.proname,
pg_catalog.pg_get_function_identity_arguments(p.oid);

/*
Monitor extension public table/view/matview/index interface
*/

select
e.extname as extension_name,
n.nspname as schema_name,
@@ -80,9 +114,6 @@ from
where
d.deptype = 'e'
and pc.relkind in ('r', 'v', 'm', 'i')
and e.extname in (
'adminpack', 'plv8', 'plls', 'plcoffee', 'old_snapshot', 'timescaledb'
)
order by
e.extname,
n.nspname,
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
/*
This test mirrors ext_interface.sql for extensions that are not yet compatible
with OrioleDB
This extension is not supported because it includes an unsupported index type
This extension is excluded from oriole-17 because it uses an unsupported index type
*/
create extension if not exists postgis_tiger_geocoder;

2 changes: 1 addition & 1 deletion nix/tests/sql/z_odb_rum.sql → nix/tests/sql/z_15_rum.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
This test is TEMPORARILY excluded from the Postgres 17 suite until OrioleDB is able to support RUM indexes
This extension is excluded from oriole-17 because it uses an unsupported index type
*/
create schema v;

File renamed without changes.
File renamed without changes.
52 changes: 52 additions & 0 deletions nix/tests/sql/z_17_pgvector.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/*
This test excludes indexes shipped with pgvector because orioledb doesn't support them yet
*/
create schema v;

create table v.items(
id serial primary key,
embedding vector(3),
half_embedding halfvec(3),
bit_embedding bit(3),
sparse_embedding sparsevec(3)
);

-- Populate some records
insert into v.items(
embedding,
half_embedding,
bit_embedding,
sparse_embedding
)
values
('[1,2,3]', '[1,2,3]', '101', '{1:4}/3'),
('[2,3,4]', '[2,3,4]', '010', '{1:7,3:0}/3');

-- Test op types
select
*
from
v.items
order by
embedding <-> '[2,3,5]',
embedding <=> '[2,3,5]',
embedding <+> '[2,3,5]',
embedding <#> '[2,3,5]',
half_embedding <-> '[2,3,5]',
half_embedding <=> '[2,3,5]',
half_embedding <+> '[2,3,5]',
half_embedding <#> '[2,3,5]',
sparse_embedding <-> '{2:4,3:1}/3',
sparse_embedding <=> '{2:4,3:1}/3',
sparse_embedding <+> '{2:4,3:1}/3',
sparse_embedding <#> '{2:4,3:1}/3',
bit_embedding <~> '011';

select
avg(embedding),
avg(half_embedding)
from
v.items;

-- Cleanup
drop schema v cascade;

0 comments on commit aff4edf

Please sign in to comment.