pgsql: Rework code using list_delete_cell() in MergeAttributes

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Rework code using list_delete_cell() in MergeAttributes
Date: 2019-06-05 06:02:03
Message-ID: E1hYOzr-00065k-PU@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Rework code using list_delete_cell() in MergeAttributes

When merging two attributes, we are sure that at least one remains.
However, when deleting one element in the attribute list we may finish
with an empty list returned as NIL by list_delete_cell(), but the code
failed to track that, which is not project-like. Adjust the call so as
we check for an empty list, and make use of it in an assertion.

This has been introduced by e7b3349, when adding support for CREATE
TABLE OF.

Author: Mark Dilger
Reviewed-by: Álvaro Herrera, Michael Paquier
Discussion: https://postgr.es/m/CAE-h2TpPDqSWgOvfvSziOaMngMPwW+QZcmPpY8hQ_KOJ2+3hXQ@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/f7e954ad1cf99a65b1785d999058898a6d56e014

Modified Files
--------------
src/backend/commands/tablecmds.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)

Browse pgsql-committers by date

  From Date Subject
Next Message David Rowley 2019-06-05 06:35:52 pgsql: Fix incorrect index behavior in COPY FROM with partitioned table
Previous Message Alvaro Herrera 2019-06-04 20:45:04 pgsql: Document piecemeal construction of partitioned indexes