Re: Add support for DEFAULT specification in COPY FROM
| От | Israel Barth Rubio |
|---|---|
| Тема | Re: Add support for DEFAULT specification in COPY FROM |
| Дата | |
| Msg-id | CAO_rXXDXn+UZNc3MV1aLjUB+YLPLCTyYyt-7FWMxr=3A+oenVQ@mail.gmail.com обсуждение исходный текст |
| Ответ на | Re: Add support for DEFAULT specification in COPY FROM (Zhihong Yu <zyu@yugabyte.com>) |
| Ответы |
Re: Add support for DEFAULT specification in COPY FROM
|
| Список | pgsql-hackers |
Hello Zhihong,
> + /* attribute is NOT to be copied from input */
>
> I think saying `is NOT copied from input` should suffice.
>
> + /* fieldno is 0-index and attnum is 1-index */
>
> + /* fieldno is 0-index and attnum is 1-index */
>
> 0-index -> 0-indexed
I have applied both suggestions, thanks! I'll submit a 4th version
I have applied both suggestions, thanks! I'll submit a 4th version
of the patch soon.
> + defaults = (bool *) palloc0(num_phys_attrs * sizeof(bool));
> + defaults = (bool *) palloc0(num_phys_attrs * sizeof(bool));
> + MemSet(defaults, false, num_phys_attrs * sizeof(bool));
>
> Is the MemSet() call necessary ?
I would say it is, so it initializes the array with all flags set to false.
Later, if it detects attributes that should evaluate their default expression,
I would say it is, so it initializes the array with all flags set to false.
Later, if it detects attributes that should evaluate their default expression,
it would set the flag to true.
Am I missing something?
Regards,
Israel.
Regards,
Israel.
В списке pgsql-hackers по дате отправления: