Re: Bulk inserts into two (related) tables

Поиск
Список
Период
Сортировка
От Francisco Olarte
Тема Re: Bulk inserts into two (related) tables
Дата
Msg-id CA+bJJbwjTGmnTw55gvjbeNfutPY1Z-PsXoz_f7ycLDGac2SPxA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Bulk inserts into two (related) tables  (Rich Shepard <rshepard@appl-ecosys.com>)
Ответы Re: Bulk inserts into two (related) tables  (Rich Shepard <rshepard@appl-ecosys.com>)
Список pgsql-general
On Tue, May 21, 2019 at 7:24 PM Rich Shepard <rshepard@appl-ecosys.com> wrote:
> > From how you say it, I assume you have some data in your original
> > dumps which can relate boths, lets assume it's org_name, but may be an
> > org-code. If you do not have it it means you cannot match people to
> > orgs in your data, all is lost.
> Not yet with these new data.
> I'll manually insert the org_id numbers from the organizations table into
> the people table.

I'm curious, what org_id do you put (manually) to the people? you must
have some way to match it ( like, say, "I have an organization line,
followed by lines for people in this organization"

Because if you cannot match them by hand, the Db is not going to be of use.

Knowing how you know the org for a people is crucial for a solution (
i.e., for the previous example I'll just add a synthetic org_code line
to each one and do the to temp tables trick for a long file, or, just
advance the sequence (if needed manually ( to reserve org_id )) and
them do a perl one liner to augment the data ( but I've been perling
since the 4.019 times, so this may not be as easy for others ).

Francisco Olarte.



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

Предыдущее
От: Fabio Ugo Venchiarutti
Дата:
Сообщение: Re: distinguish update from insert (on conflict)
Следующее
От: Francisco Olarte
Дата:
Сообщение: Re: Bulk inserts into two (related) tables