agora inbox for pgsql-sql@postgresql.org  
help / color / mirror / Atom feed
extracting PII data and transforming it across table.
5+ messages / 3 participants
[nested] [flat]

* extracting PII data and transforming it across table.
@ 2015-05-21 16:27  Suresh Raja <suresh.rajaabc@gmail.com>
  0 siblings, 2 replies; 5+ messages in thread

From: Suresh Raja @ 2015-05-21 16:27 UTC (permalink / raw)
  To: pgsql-general@postgresql.org; pgsql-sql

Hi Folks:

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

^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: extracting PII data and transforming it across table.
@ 2015-05-21 16:33  Steve Midgley <science@misuse.org>
  parent: Suresh Raja <suresh.rajaabc@gmail.com>
  1 sibling, 1 reply; 5+ messages in thread

From: Steve Midgley @ 2015-05-21 16:33 UTC (permalink / raw)
  To: Suresh Raja <suresh.rajaabc@gmail.com>; +Cc: pgsql-general@postgresql.org; pgsql-sql

I would update the IDs using SQL before dumping if possible. If necessary
clone the tables, adjust the IDs and then dump. SQL has better tools than
most languages/scripts to adjust values in columns across multiple
entities. Plus it should be easier to build some test queries in SQL to
validate that your ID adjustments were valid.

On Thu, May 21, 2015 at 9:27 AM, Suresh Raja <suresh.rajaabc@gmail.com>
wrote:

> Hi Folks:
>
> 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
>

^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: extracting PII data and transforming it across table.
@ 2015-05-21 16:51  Suresh Raja <suresh.rajaabc@gmail.com>
  parent: Steve Midgley <science@misuse.org>
  0 siblings, 1 reply; 5+ messages in thread

From: Suresh Raja @ 2015-05-21 16:51 UTC (permalink / raw)
  To: Steve Midgley <science@misuse.org>; +Cc: pgsql-general@postgresql.org; pgsql-sql

On Thu, May 21, 2015 at 11:33 AM, Steve Midgley <science@misuse.org> wrote:

> I would update the IDs using SQL before dumping if possible. If necessary
> clone the tables, adjust the IDs and then dump. SQL has better tools than
> most languages/scripts to adjust values in columns across multiple
> entities. Plus it should be easier to build some test queries in SQL to
> validate that your ID adjustments were valid.
>
> On Thu, May 21, 2015 at 9:27 AM, Suresh Raja <suresh.rajaabc@gmail.com>
> wrote:
>
>> Hi Folks:
>>
>> 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.

Thanks for prompt reply.

^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: [SQL] extracting PII data and transforming it across table.
@ 2015-05-28 04:57  John R Pierce <pierce@hogranch.com>
  parent: Suresh Raja <suresh.rajaabc@gmail.com>
  0 siblings, 0 replies; 5+ messages in thread

From: John R Pierce @ 2015-05-28 04:57 UTC (permalink / raw)
  To: pgsql-general@postgresql.org

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

^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: extracting PII data and transforming it across table.
@ 2015-06-22 21:09  Suresh Raja <suresh.rajaabc@gmail.com>
  parent: Suresh Raja <suresh.rajaabc@gmail.com>
  1 sibling, 0 replies; 5+ messages in thread

From: Suresh Raja @ 2015-06-22 21:09 UTC (permalink / raw)
  To: pgsql-general@postgresql.org; pgsql-sql

Hi All:

Does postgresql support schema analyze.  I could not find analyze schema
anywhere.  Can we create a function to run analyze and reindex on all
objects in the schema.  Any suggestions or ideas.

Thanks,
-Suresh Raja

^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2015-06-22 21:09 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2015-05-21 16:27 extracting PII data and transforming it across table. Suresh Raja <suresh.rajaabc@gmail.com>
2015-05-21 16:33 ` Steve Midgley <science@misuse.org>
2015-05-21 16:51   ` Suresh Raja <suresh.rajaabc@gmail.com>
2015-05-28 04:57     ` John R Pierce <pierce@hogranch.com>
2015-06-22 21:09 ` Suresh Raja <suresh.rajaabc@gmail.com>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox