Search Postgresql Archives

Re: Bulk inserts into two (related) tables

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

 



On Wed, 22 May 2019, Jeremy Finzel wrote:

Are you saying your database already has an organizations table, and this
data file is appending to it with all-brand-new organizations and people?

Jeremy,

The database has both organizations and people tables (among others) which
are already populated. The source file appends rows to both tables.

Say you have 800 people. Are you honestly saying that there are also 800
organizations? If so, I guess your solution would work. However, I thought
that it was the case that multiple people belong to the same organization.
Hence, the entire problem of mapping we have been discussing.

No. But, each organization may have several people, each one at a different
facility. Think of a bank with one headquarters but different mangers in
each of their branches.

Also, you said previously that some fields from your data file would be
populated in *both tables*. That is a fundamental violation of DB design.
Why are you duplicating that data in two places?

Not if the duplicated data field is the primary key in the organizations
table and the referenced foreign key in the people table.

Regards,

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