Re: Add support for DEFAULT specification in COPY FROM

Поиск
Список
Период
Сортировка
От Zhihong Yu
Тема Re: Add support for DEFAULT specification in COPY FROM
Дата
Msg-id CALNJ-vQeoRAVzi4cjpPHc0xesZnhrbTVz6PWnNJuBrFFk6eFBA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Add support for DEFAULT specification in COPY FROM  (Israel Barth Rubio <barthisrael@gmail.com>)
Ответы Re: Add support for DEFAULT specification in COPY FROM  (Israel Barth Rubio <barthisrael@gmail.com>)
Список pgsql-hackers


On Mon, Sep 26, 2022 at 8:12 AM Israel Barth Rubio <barthisrael@gmail.com> wrote:
Hello Andrew,

> . There needs to be a check that this is being used with COPY FROM, and
> the restriction needs to be stated in the docs and tested for. c.f.
> FORCE NULL.

> . There needs to be support for this in psql's tab_complete.c, and
> appropriate tests added

> . There needs to be support for it in contrib/file_fdw/file_fdw.c, and a
> test added

> . The tests should include psql's \copy as well as sql COPY

> . I'm not sure we need a separate regression test file for this.
> Probably these tests can go at the end of src/test/regress/sql/copy2.sql.

Thanks for your review! I have applied the suggested changes, and I'm
submitting the new patch version.

Kind regards,
Israel.

Hi,

+               /* attribute is NOT to be copied from input */ 

I think saying `is NOT copied from input` should suffice.

+   defaults = (bool *) palloc0(num_phys_attrs * sizeof(bool));
+   MemSet(defaults, false, num_phys_attrs * sizeof(bool));

Is the MemSet() call necessary ?

+           /* fieldno is 0-index and attnum is 1-index */

0-index -> 0-indexed

Cheers

В списке pgsql-hackers по дате отправления:

Предыдущее
От: James Coleman
Дата:
Сообщение: Re: Consider parallel for lateral subqueries with limit
Следующее
От: Robert Haas
Дата:
Сообщение: Re: has_privs_of_role vs. is_member_of_role, redux