Re: Bulk inserts into two (related) tables

Поиск
Список
Период
Сортировка
От Rich Shepard
Тема Re: Bulk inserts into two (related) tables
Дата
Msg-id alpine.LNX.2.20.1905211128160.6551@salmo.appl-ecosys.com
обсуждение исходный текст
Ответ на Re: Bulk inserts into two (related) tables  (Will Hartung <willhartung@gmail.com>)
Список pgsql-general
On Tue, 21 May 2019, Will Hartung wrote:

> You can either use a script for the entire process, or, convert the people
> table to INSERT statements that have a SELECT for the foreign key as part
> of the insert.
>
> INSERT INTO PEOPLE (id, name, org_id) VALUES (1, ‘Bob’, (SELECT org_id
> FROM org WHERE org_name=‘Main Office’))

Thanks, Will. That's a good alternative.

Regards,

Rich



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Re: Re: Refresh Publication takes hours and doesn´t finish
Следующее
От: Jeremy Finzel
Дата:
Сообщение: Re: Bulk inserts into two (related) tables