pgsql: Code review for commands/statscmds.c.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Code review for commands/statscmds.c.
Date: 2017-04-24 15:15:21
Message-ID: E1d2fhx-0003iK-J1@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Code review for commands/statscmds.c.

Fix machine-dependent sorting of column numbers. (Odd behavior
would only materialize for column numbers above 255, but that's
certainly legal.)

Fix poor choice of SQLSTATE for some errors, and improve error message
wording. (Notably, "is not a scalar type" is a totally misleading way
to explain "does not have a default btree opclass".)

Avoid taking AccessExclusiveLock on the associated relation during DROP
STATISTICS. That's neither necessary nor desirable, and it could easily
have put us into situations where DROP fails (compare commit 68ea2b7f9).

Adjust/improve comments.

David Rowley and Tom Lane

Discussion: https://postgr.es/m/CAKJS1f-GmCfPvBbAEaM5xoVOaYdVgVN1gicALSoYQ77z-+vLbw@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/4b34624daadd9837cd65f20419f832b295c67ecb

Modified Files
--------------
src/backend/commands/statscmds.c | 67 ++++++++++++++++++---------------
src/test/regress/expected/stats_ext.out | 2 +-
2 files changed, 38 insertions(+), 31 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2017-04-24 16:17:16 pgsql: Fix postmaster's handling of fork failure for a bgworker process
Previous Message Andrew Gierth 2017-04-24 07:03:20 pgsql: Repair crash with unsortable data in grouping sets.