Functional_Test.md

October 30, 2018 · View on GitHub

功能性测试

  • 测试表结构
postgres=# \d+ partitioned_table
                              Table "public.partitioned_table"
 Column  |  Type   | Collation | Nullable | Default | Storage  | Stats target | Description
---------+---------+-----------+----------+---------+----------+--------------+-------------
 id      | integer |           | not null |         | plain    |              |
 payload | real    |           |          |         | plain    |              |
 name    | text    |           |          |         | extended |              |
Child tables: partitioned_table_0,
              partitioned_table_1,
              partitioned_table_2,
              partitioned_table_3
  • 测试SQL通过性列表
SQL是否通过
alter table partitioned_table add column name text;
alter table partitioned_table alter column name type varchar(30);
select max(id) from partitioned_table;
select min(payload) from partitioned_table where id<2;
select * from partitioned_table where name !='';
create index CONCURRENTLY index_parttion_id on partitioned_table(id);
drop index "index_parttion_id";
select id,count(*) from partitioned_table group by id order by id limit 6;
select * from partitioned_table a left join gwtest01 b on a.id=b.id;
select * from partitioned_table a left join gwtest01 b on a.id=b.id where a.id=6;
select avg(payload) from partitioned_table where id <2;
select count(distinct(id)) from partitioned_table where id=3;
select count(distinct(id)) from partitioned_table;
select id,count(*) from partitioned_table group by id having true;
select count(*) from partitioned_table where id <2;
select * from partitioned_table limit 10;
select count(*) from partitioned_table;
delete from partitioned_table where name='hello';
insert into partitioned_table values(11,0.35,'cstech');
copy (select * from partitioned_table) to '/tmp/test.csv';
copy partitioned_table from '/tmp/a.txt';
SELECT * FROM part_hash_test WHERE id>(select avg(id) from part_hash_test);