mirror of
https://github.com/postgres/postgres.git
synced 2026-02-19 02:29:10 -05:00
The standard way to check for list emptiness is to compare the List pointer to NIL; our list code goes out of its way to ensure that that is the only representation of an empty list. (An acceptable alternative is a plain boolean test for non-null pointer, but explicit mention of NIL is usually preferable.) Various places didn't get that memo and expressed the condition with list_length(), which might not be so bad except that there were such a variety of ways to check it exactly: equal to zero, less than or equal to zero, less than one, yadda yadda. In the name of code readability, let's standardize all those spellings as "list == NIL" or "list != NIL". (There's probably some microscopic efficiency gain too, though few of these look to be at all performance-critical.) A very small number of cases were left as-is because they seemed more consistent with other adjacent list_length tests that way. Peter Smith, with bikeshedding from a number of us Discussion: https://postgr.es/m/CAHut+PtQYe+ENX5KrONMfugf0q6NHg4hR5dAhqEXEc2eefFeig@mail.gmail.com |
||
|---|---|---|
| .. | ||
| brin | ||
| commit_ts | ||
| delay_execution | ||
| dummy_index_am | ||
| dummy_seclabel | ||
| libpq_pipeline | ||
| plsample | ||
| snapshot_too_old | ||
| spgist_name_ops | ||
| ssl_passphrase_callback | ||
| test_bloomfilter | ||
| test_ddl_deparse | ||
| test_extensions | ||
| test_ginpostinglist | ||
| test_integerset | ||
| test_lfind | ||
| test_misc | ||
| test_oat_hooks | ||
| test_parser | ||
| test_pg_dump | ||
| test_predtest | ||
| test_rbtree | ||
| test_regex | ||
| test_rls_hooks | ||
| test_shm_mq | ||
| unsafe_tests | ||
| worker_spi | ||
| Makefile | ||
| README | ||
Test extensions and libraries ============================= src/test/modules contains PostgreSQL extensions that are primarily or entirely intended for testing PostgreSQL and/or to serve as example code. The extensions here aren't intended to be installed in a production server and aren't suitable for "real work". Furthermore, while you can do "make install" and "make installcheck" in this directory or its children, it is NOT ADVISABLE to do so with a server containing valuable data. Some of these tests may have undesirable side-effects on roles or other global objects within the tested server. "make installcheck-world" at the top level does not recurse into this directory. Most extensions have their own pg_regress tests or isolationtester specs. Some are also used by tests elsewhere in the tree. If you're adding new hooks or other functionality exposed as C-level API this is where to add the tests for it.