Re: Process for populating tables in new database [RESOLVED]

Поиск
Список
Период
Сортировка
От Rich Shepard
Тема Re: Process for populating tables in new database [RESOLVED]
Дата
Msg-id alpine.LNX.2.20.1812010729220.8748@salmo.appl-ecosys.com
обсуждение исходный текст
Ответ на Re: Process for populating tables in new database  (Adrian Klaver <adrian.klaver@aklaver.com>)
Список pgsql-general
On Sat, 1 Dec 2018, Adrian Klaver wrote:

> If you don't supply the key it will be generated as the default for the PK 
> column is a sequence.

   Thanks, Adrian. I thought this to be the case and did not find
confirmation in the manual (perhaps I just missed seeing it.)

> So are the tables you are INSERTing into currently unpopulated?

   Yes.

> In any case you will need to do this in sequence, where you populate the
> company table and then the contact table. The question is whether you want
> to pre-assign the company id's in the company data and the company_id_fk
> in the contacts data or not. If not then you will need to grab the company
> id's after populating the company table and match those to the contacts
> data before inserting it.

   This clears up everything. I'll let pg assign company id's then use them
as you write to relate the other tables to the proper company/contact.

Much appreciated,

Rich


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

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: Process for populating tables in new database
Следующее
От: Rich Shepard
Дата:
Сообщение: Re: Process for populating tables in new database