mirror of
https://github.com/postgres/postgres.git
synced 2026-03-29 05:43:27 -04:00
The idea behind this patch is to make it possible to run individual test scripts without running the entire core test suite. Making all the scripts completely independent would involve a massive rewrite, and would probably be worse for coverage of things like concurrent DDL. So this patch just does what seems practical with limited changes. The net effect is that any test script can be run after running limited earlier dependencies: * all scripts depend on test_setup * many scripts depend on create_index * other dependencies are few in number, and are documented in the parallel_schedule file. To accomplish this, I chose a small number of commonly-used tables and moved their creation and filling into test_setup. Later scripts are expected not to modify these tables' data contents, for fear of affecting other scripts' results. Also, our former habit of declaring all C functions in one place is now gone in favor of declaring them where they're used, if that's just one script, or in test_setup if necessary. There's more that could be done to remove some of the remaining inter-script dependencies, but significantly more-invasive changes would be needed, and at least for now it doesn't seem worth it. Discussion: https://postgr.es/m/1114748.1640383217@sss.pgh.pa.us
19 lines
587 B
SQL
19 lines
587 B
SQL
--
|
|
-- SELECT_DISTINCT_ON
|
|
--
|
|
|
|
SELECT DISTINCT ON (string4) string4, two, ten
|
|
FROM onek
|
|
ORDER BY string4 using <, two using >, ten using <;
|
|
|
|
-- this will fail due to conflict of ordering requirements
|
|
SELECT DISTINCT ON (string4, ten) string4, two, ten
|
|
FROM onek
|
|
ORDER BY string4 using <, two using <, ten using <;
|
|
|
|
SELECT DISTINCT ON (string4, ten) string4, ten, two
|
|
FROM onek
|
|
ORDER BY string4 using <, ten using >, two using <;
|
|
|
|
-- bug #5049: early 8.4.x chokes on volatile DISTINCT ON clauses
|
|
select distinct on (1) floor(random()) as r, f1 from int4_tbl order by 1,2;
|