- Download the product delivery file.
- Extract the delivery file to find the data text file.
- Open the Property Historical Sales Change Log Create Table script in a text editor and confirm that the table name is set to prop_hist_sales_change_log.
- Run the Create Table script.
- After the table structure has been created, copy data using the PostgreSQL
Copy command:
Syntax:copy <table_name> from '<path_to_text_file>\<text_file_name.txt>' delimiter '|' csv quote e'\b';<table_name>: Name of table created using Create Table script
<path_to_text_file>: Path to extracted data text file
<text_file_name.txt>: Extracted data text file name, including file extension
delimiter: Defines the text delimiter (in this case, the pipe character)
csv quote e'/b': Specifies quoting
Example – Linux:Example – Windows:copy prop_hist_sales_change_log from '/mnr/nationwide/Property_Historical_Sales/ Change_Files/property_historical_sales_changelog_usa.txt' delimiter '|' csv quote e'\b';copy prop_hist_sales_change_log from 'F:/Property_Historical_Sales_202009/ Change_Files/property_historical_sales_changelog_usa.txt' delimiter '|' csv quote e'\b';