Search Postgresql Archives

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux