From: Rich Shepard <rshepard@appl-ecosys.com>
To: pgsql-general@postgresql.org
Subject: Re: Process for populating tables in new database [RESOLVED]
Date: Sat, 1 Dec 2018 07:32:27 -0800 (PST)
Message-ID: <alpine.LNX.2.20.1812010729220.8748@salmo.appl-ecosys.com> (raw)
In-Reply-To: <46b7813b-9c5c-c98f-8895-88bc4de635e7@aklaver.com>
References: <alpine.LNX.2.20.1812010606370.8748@salmo.appl-ecosys.com>
<46b7813b-9c5c-c98f-8895-88bc4de635e7@aklaver.com>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: rshepard@appl-ecosys.com
Subject: Re: Process for populating tables in new database [RESOLVED]
In-Reply-To: <alpine.LNX.2.20.1812010729220.8748@salmo.appl-ecosys.com>
References: <alpine.LNX.2.20.1812010606370.8748@salmo.appl-ecosys.com> <46b7813b-9c5c-c98f-8895-88bc4de635e7@aklaver.com> <alpine.LNX.2.20.1812010729220.8748@salmo.appl-ecosys.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox