Tuesday, May 4, 2010

Issue_1

A friend asked me this question. If u were asked this same question what will be your asnwer?

"I am trying to submit data more like a CV. ExtJS->Php->Postgres. Data collection and processing guaranteed. But as you might have already sensed, like CVs, employment records are multiple (2D). qualifications/certificates are multiple (2D), and schools attended likewise. What is your best approach to insert all these records into PGSQL in one trip - obviously considering rollbacks on errors.

I have a candidate table, and employment,certificates,schools tables - each of them with a candidate_id as foreign key.

My approach is to do a standard insert into candidate table, returning the new candidate_id and in some way, append/prepend to each of the records that I have serialized into a string of 2D matrix for each of (certificate/qualification/employment)

Within PG-SQL, I am thinking of using 'regexp_split_to_table' even though am also fancying a 'array_to_table' and 'unnest' combo, the latter supported PGSQL8.4

In all these, my greatest enemy is time and so I am thinking of a paralelizing the thinking using sharp brains like those on this BUZZ."

No comments:

Post a Comment