Re: Keep notnullattrs in RelOptInfo (Was part of UniqueKey patch series) - Mailing list pgsql-hackers

From Ranier Vilela
Subject Re: Keep notnullattrs in RelOptInfo (Was part of UniqueKey patch series)
Date
Msg-id CAEudQArL_WFiU5ZkheToVXDwRf9nf8S_yMn94RyLmhgQd+qyFg@mail.gmail.com
Whole thread Raw
In response to Keep notnullattrs in RelOptInfo (Was part of UniqueKey patch series)  (Andy Fan <zhihui.fan1213@gmail.com>)
List pgsql-hackers

>You can check the more details in the attached patch. Any feedback is welcome.

I have tiny comments about your patch:

1. name of file is uniquekey.c?

+ * pathkeys.c
+ *  Utilities for maintaining uniquekey.

2. Variable "PathKey *pathkey" at function: add_uniquekey_for_uniqueindex, can have scope reduced.

+ indexpr_item = list_head(unique_index->indexprs);
+ for (c = 0; c < unique_index->nkeycolumns; c++)
+ {
+ PathKey *pathkey;

3. Variable int c = 0, has a redundant initialization at function: add_uniquekey_for_uniqueindex.

4. Has one word with misspelled?

"/* We can't *guarantee* an FuncExpr will not return NULLs */"

4. Variable int i = -1, has a redudant initialization at function: uniquekey_contains_in

5. __attribute__ ((unused)) at function: build_composited_uniquekey, is incompatible with msvc.

6. Postgres uses a newline after variables declarations.

regards,

Ranier Vilela


pgsql-hackers by date:

Previous
From: ilmari@ilmari.org (Dagfinn Ilmari Mannsåker)
Date:
Subject: Re: PostgreSQL-13.3 parser.y with positional references by named references
Next
From: Daniel Gustafsson
Date:
Subject: Re: Warn if initdb's --sync-only option is mixed with other options