Re: [SQL] extracting PII data and transforming it across table.

From: John R Pierce <pierce(at)hogranch(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: [SQL] extracting PII data and transforming it across table.
Date: 2015-05-28 04:57:43
Message-ID: 5566A047.20803@hogranch.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-sql

On 5/21/2015 9:51 AM, Suresh Raja wrote:
>
> I'm looking at directions or help in extracting data from
> production and alter employee id information while
> extracting. But at the same time maintain referential
> integrity across tables. Is it possible to dump data to flat
> file and then run some script to change emp id data on all
> files. I'm looking for a easy solution.
>
> Thanks,
> -Suresh Raja
>
>
> Steve:
> I too would like to update the id's before dumping. can i write a sql
> to union all tables and at the same time create unique key valid
> across tables.

it sounds like you have a weak grasp of delational database design

I would have a single Employee table, with employee ID as the primary
key, and any other attributes which are common to all employees, then I
would have other tables which contain information about specific
employee types or groups, these other tables could have their own
primary key, but would reference the Employee table EmployeeID field for
the common employee attributes.

--
john r pierce, recycling bits in santa cruz

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Nivedita Kulkarni 2015-05-28 07:14:14 [Postgresql NLS support] : Help on using NLS , Custom dictionary to enhance our website search functionality
Previous Message Tom Lane 2015-05-28 04:31:04 Re: Constraint exclusion not working - need different constraints?

Browse pgsql-sql by date

  From Date Subject
Next Message Shashwat Arghode 2015-05-28 06:23:45 Drop or disable or bypass "_return" rule on select on a view.
Previous Message daku.sandor 2015-05-27 06:24:00 Re: Postgres CTE issues