pgsql: Tab completion: don't offer valid constraints in VALIDATE CONSTR

2022-01-03 Thread Tom Lane
Tab completion: don't offer valid constraints in VALIDATE CONSTRAINT. Improve psql so that "ALTER TABLE foo VALIDATE CONSTRAINT " only offers not-convalidated entries. While it's not formally wrong to offer validated ones, there's not much point either, and it can save some typing if we incorpora

pgsql: Handle mixed returnable and non-returnable columns better in IOS

2022-01-03 Thread Tom Lane
Handle mixed returnable and non-returnable columns better in IOS. We can revert the code changes of commit b5febc1d1 now, because commit 9a3ddeb51 installed a real solution for the difficulty that b5febc1d1 just dodged, namely that the planner might pick the wrong one of several index columns nomi

pgsql: Fix index-only scan plans, take 2.

2022-01-03 Thread Tom Lane
Fix index-only scan plans, take 2. Commit 4ace45677 failed to fix the problem fully, because the same issue of attempting to fetch a non-returnable index column can occur when rechecking the indexqual after using a lossy index operator. Moreover, it broke EXPLAIN for such indexquals (which indica

pgsql: Fix index-only scan plans, take 2.

2022-01-03 Thread Tom Lane
Fix index-only scan plans, take 2. Commit 4ace45677 failed to fix the problem fully, because the same issue of attempting to fetch a non-returnable index column can occur when rechecking the indexqual after using a lossy index operator. Moreover, it broke EXPLAIN for such indexquals (which indica

pgsql: Fix index-only scan plans, take 2.

2022-01-03 Thread Tom Lane
Fix index-only scan plans, take 2. Commit 4ace45677 failed to fix the problem fully, because the same issue of attempting to fetch a non-returnable index column can occur when rechecking the indexqual after using a lossy index operator. Moreover, it broke EXPLAIN for such indexquals (which indica

pgsql: Fix index-only scan plans, take 2.

2022-01-03 Thread Tom Lane
Fix index-only scan plans, take 2. Commit 4ace45677 failed to fix the problem fully, because the same issue of attempting to fetch a non-returnable index column can occur when rechecking the indexqual after using a lossy index operator. Moreover, it broke EXPLAIN for such indexquals (which indica

pgsql: Fix index-only scan plans, take 2.

2022-01-03 Thread Tom Lane
Fix index-only scan plans, take 2. Commit 4ace45677 failed to fix the problem fully, because the same issue of attempting to fetch a non-returnable index column can occur when rechecking the indexqual after using a lossy index operator. Moreover, it broke EXPLAIN for such indexquals (which indica

pgsql: Fix index-only scan plans, take 2.

2022-01-03 Thread Tom Lane
Fix index-only scan plans, take 2. Commit 4ace45677 failed to fix the problem fully, because the same issue of attempting to fetch a non-returnable index column can occur when rechecking the indexqual after using a lossy index operator. Moreover, it broke EXPLAIN for such indexquals (which indica

pgsql: Clean up error messages related to bad datetime units.

2022-01-03 Thread Tom Lane
Clean up error messages related to bad datetime units. Adjust the error texts used for unrecognized/unsupported datetime units so that there are just two strings to translate, not two per datatype. Along the way, follow our usual error message style of not double-quoting type names, and instead m

pgsql: Use MaxLockMode symbol in more places.

2022-01-03 Thread Tom Lane
Use MaxLockMode symbol in more places. As long as we have this macro, it makes sense to use it in the LockMethodData structures. Julien Rouhaud Discussion: https://postgr.es/m/20220103064722.ewdv4evlez5m7mdn@jrouhaud Branch -- master Details --- https://git.postgresql.org/pg/commitdiff

pgsql: Avoid using DefElemAction in AlterPublicationStmt

2022-01-03 Thread Alvaro Herrera
Avoid using DefElemAction in AlterPublicationStmt Create a new enum type for it. This allows to add new values for future functionality without disrupting unrelated uses of DefElem. Discussion: https://postgr.es/m/[email protected] Branch -- master Details --- ht

pgsql: pg_stat_statements: Remove obsolete comment

2022-01-03 Thread Michael Paquier
pg_stat_statements: Remove obsolete comment Since 4f0b096, pgss_store() does nothing if compute_query_id is disabled or if no other module computed a query identifier, but the top comment of this function did not reflect that. This behavior is already documented in its own code path, and this jus

pgsql: pg_stat_statements: Remove obsolete comment

2022-01-03 Thread Michael Paquier
pg_stat_statements: Remove obsolete comment Since 4f0b096, pgss_store() does nothing if compute_query_id is disabled or if no other module computed a query identifier, but the top comment of this function did not reflect that. This behavior is already documented in its own code path, and this jus