10PoundBrown
MIS
Ok, so my DBA labeled a column "ORDER" which is a SQL reserved work. Not smart. Unfortunately I cant take the time to drop the column, re-add at it with a new name and dump the data back in. This sucks. I am trying to save the MIS folks some heartache by using copy to dump a bunch of data into the backend and COPY poops out when it finds the ORDER column. Check it out.
varius=# COPY tracker.schedule_items (SCHEDULE_ID,ORDER,NAME,BASELINE_DURATION,BASELINE_LAG_TYPE_ID,BASELINE_LAG_DURATION,BASELINE_COST_LABOR,BASELINE_COST_MATERIALS,BASELINE_COST_EXPENSES,STATUS_ID,PROGRESS) from '/home/brown_c/BARKSDALE_NEW.csv' WITH DELIMITER ',';
ERROR: parser: parse error at or near "ORDER" at character 42
Ok, so I quote that ORDER column...lets try that out.
varius=# COPY tracker.schedule_items (SCHEDULE_ID,"ORDER",NAME,BASELINE_DURATION,BASELINE_LAG_TYPE_ID,BASELINE_LAG_DURATION,BASELINE_COST_LABOR,BASELINE_COST_MATERIALS,BASELINE_COST_EXPENSES,STATUS_ID,PROGRESS) from '/home/brown_c/BARKSDALE_NEW.csv' WITH DELIMITER ',';
ERROR: Relation "schedule_items" has no column "ORDER"
Oh my, I can assure you that the table does have an ORDER column. what to do, what to do?
If anybody has any smart ideas on how I might overcome this hurdle, I would gladly buy you a beer and slice of pizza. Meanwhile, I am going to go berate my DBA for being a peeesa-krap.
varius=# COPY tracker.schedule_items (SCHEDULE_ID,ORDER,NAME,BASELINE_DURATION,BASELINE_LAG_TYPE_ID,BASELINE_LAG_DURATION,BASELINE_COST_LABOR,BASELINE_COST_MATERIALS,BASELINE_COST_EXPENSES,STATUS_ID,PROGRESS) from '/home/brown_c/BARKSDALE_NEW.csv' WITH DELIMITER ',';
ERROR: parser: parse error at or near "ORDER" at character 42
Ok, so I quote that ORDER column...lets try that out.
varius=# COPY tracker.schedule_items (SCHEDULE_ID,"ORDER",NAME,BASELINE_DURATION,BASELINE_LAG_TYPE_ID,BASELINE_LAG_DURATION,BASELINE_COST_LABOR,BASELINE_COST_MATERIALS,BASELINE_COST_EXPENSES,STATUS_ID,PROGRESS) from '/home/brown_c/BARKSDALE_NEW.csv' WITH DELIMITER ',';
ERROR: Relation "schedule_items" has no column "ORDER"
Oh my, I can assure you that the table does have an ORDER column. what to do, what to do?
If anybody has any smart ideas on how I might overcome this hurdle, I would gladly buy you a beer and slice of pizza. Meanwhile, I am going to go berate my DBA for being a peeesa-krap.