mccgr / edgar

Code to manage data related to SEC EDGAR
31 stars 15 forks source link

Rename tables #46

Closed iangow closed 5 years ago

iangow commented 5 years ago

I think it would be better if xml_fully_processed and xml_process_table were to have table names that began with forms345 to keep them with the other tables.

 edgar  | forms345_footnote_indices | table | edgar    | 1271 MB    | Created/Updated by process_345_xml_documents.R on 2018-12-14 15:51:04
 edgar  | forms345_footnotes        | table | edgar    | 1670 MB    | Created/Updated by process_345_xml_documents.R on 2018-12-14 15:51:04
 edgar  | forms345_header           | table | edgar    | 412 MB     | Created/Updated by process_345_xml_documents.R on 2018-12-14 15:51:04
 edgar  | forms345_reporting_owners | table | edgar    | 617 MB     | Created/Updated by process_345_xml_documents.R on 2018-12-14 15:51:04
 edgar  | forms345_signatures       | table | edgar    | 425 MB     | Created/Updated by process_345_xml_documents.R on 2018-12-14 15:51:04
 edgar  | forms345_table1           | table | edgar    | 1099 MB    | Created/Updated by process_345_xml_documents.R on 2018-12-14 15:51:04
 edgar  | forms345_table2           | table | edgar    | 626 MB     | Created/Updated by process_345_xml_documents.R on 2018-12-14 15:51:04
 edgar  | index_last_modified       | table | edgar    | 8192 bytes | 
 edgar  | item_no                   | table | edgar    | 273 MB     | 
 edgar  | item_no_desc              | table | edgar    | 16 kB      | 
 edgar  | problems                  | table | bdcallen | 16 MB      | 
 edgar  | server_log                | table | igow     | 3176 kB    | 
 edgar  | server_log_processed      | table | igow     | 16 kB      | 
 edgar  | xml_fully_processed       | table | edgar    | 218 MB     | Created/Updated by process_345_xml_documents.R on 2018-12-14 15:51:04
 edgar  | xml_process_table         | table | edgar    | 460 MB     | Created/Updated by process_345_xml_documents.R on 2018-12-14 15:51:04
bdcallen commented 5 years ago

@iangow I just did

> dbExecute(pg, "ALTER TABLE edgar.xml_process_table RENAME TO forms345_xml_process_table")
[1] 0
> dbExecute(pg, "ALTER TABLE edgar.xml_fully_processed RENAME TO forms345_xml_fully_processed")
[1] 0

and the renamings were successful when I checked the table names in edgar in pgAdmin. Also, I have changed xml_process_table to forms345_xml_process_table, and xml_fully_processed to forms345_xml_fully_processed, where relevant in forms_345_xml_functions.R and process_345_xml_documents.R (see the above commits)

iangow commented 5 years ago

Thanks.