Re: Add CINE for ALTER TABLE ... ADD COLUMN - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: Add CINE for ALTER TABLE ... ADD COLUMN
Date
Msg-id CAB7nPqSKgAmhZoXqrV6LR33xNgxf-47a7noMvquV5eHPT3p94g@mail.gmail.com
Whole thread Raw
In response to Re: Add CINE for ALTER TABLE ... ADD COLUMN  (Fabrízio de Royes Mello <fabriziomello@gmail.com>)
Responses Re: Add CINE for ALTER TABLE ... ADD COLUMN
List pgsql-hackers
On Fri, Jun 26, 2015 at 12:41 AM, Fabrízio de Royes Mello
<fabriziomello@gmail.com> wrote:
>
>
> On Wed, Jun 24, 2015 at 3:36 PM, Alvaro Herrera <alvherre@2ndquadrant.com>
> wrote:
>>
>> Fabrízio de Royes Mello wrote:
>>
>> > Another rebased version.
>>
>> There are a number of unrelated whitespace changes in this patch; also
>> please update the comment on top of check_for_column_name_collision.
>>
>
> Sorry, bad merging after a pgident run. Comments on top of
> check_for_column_name collision also updated.

I had a look at this patch, and here are some minor comments:
1) In alter_table.sgml, you need a space here:
[ IF NOT EXISTS ]<replaceable
2)
+       check_for_column_name_collision(targetrelation, newattname, false);
(void) needs to be added in front of check_for_column_name_collision
where its return value is not checked or static code analyzers are
surely going to complain.
3) Something minor, some lines of codes exceed 80 characters, see
declaration of check_for_column_name_collision for example...
4) This comment needs more precisions?       /* new name should not already exist */
-       check_for_column_name_collision(rel, colDef->colname);
+       if (!check_for_column_name_collision(rel, colDef->colname,
if_not_exists))
The new name can actually exist if if_not_exists is true.

Except that the implementation looks sane to me.
Regards,
--
Michael



pgsql-hackers by date:

Previous
From: Haribabu Kommi
Date:
Subject: Re: optimizing vacuum truncation scans
Next
From: Fujii Masao
Date:
Subject: Re: Re: [COMMITTERS] pgsql: Map basebackup tablespaces using a tablespace_map file