Re: Modifying database schema without losing data

2020-09-28 Thread Rich Shepard
On Mon, 28 Sep 2020, Tom Lane wrote: No part-timers in your universe? (My friends in the restaurant business would surely find the above pretty laughable.) Tom, Not in the markets I serve; at least, not at the environmental manager level. I don't work for retail businesses; primarily natural

Re: Modifying database schema without losing data

2020-09-28 Thread Tom Lane
Rich Shepard writes: > On Mon, 28 Sep 2020, Adam Scott wrote: >> What if a person is a member of more than one Org? Consider a person_org >> table. > Not applicable. An individual is employed by a single organization. No part-timers in your universe? (My friends in the restaurant business woul

Re: Modifying database schema without losing data

2020-09-28 Thread Rich Shepard
On Mon, 28 Sep 2020, Adam Scott wrote: What if a person is a member of more than one Org? Consider a person_org table. Adam, Not applicable. An individual is employed by a single organization. I see mention of a site in the person table. It may also be the case that you need a site table.

Re: Modifying database schema without losing data

2020-09-28 Thread Adam Scott
What if a person is a member of more than one Org? Consider a person_org table. I see mention of a site in the person table. It may also be the case that you need a site table. Often, you want a table for the Person and a Contact (or Address) table separately. This allows for having more than

Re: Modifying database schema without losing data

2020-09-28 Thread Rich Shepard
On Mon, 28 Sep 2020, Adrian Klaver wrote: You could use INSERT INTO location(new_fields,) SELECT the_fields FROM the_table(s). Well, duh! I could have thought of that. That's exactly what I'll do: Create the new table, move data from the old table into it, then drop columns in the old table .

Re: Modifying database schema without losing data

2020-09-28 Thread Adrian Klaver
On 9/28/20 10:15 AM, Rich Shepard wrote: I've been developing a business tracking application for my own use and it's worked well up to now. But, I need to modify it by adding a table with attributes from two other tables. I've not drawn a E-R diagram so I show the two existing tables here: C